 Let me introduce you to our first speaker for the day. He is Vipin Kumar. He is going to speak about the file server. So over to you Vipin. Stay with us. Thanks. Thank you so much. Just for checking everyone, can you guys hear me? Because just there from beside there is some audio village. By the time that we start my screen sharing. Is my screen visible to you all? It's the PPD, the file server for Python 2021. Yeah, I guess it is. So hello everyone, my name is Vipin and I'm using Python since last five years. I had a work experience of two years and the tool. So I'm a testing engineer and the tool which I use to test is based on Python's Django framework. So today I will be giving you an overview of an application which I developed using Python's class module. And I named it as the file server because it basically perform operations on files like uploading, downloading and replacing. So it's kind of an file explorer thing, but it has a bunch of interfaces that might help you in automating bunch of stuff. So let's move ahead. So the second slide says why we will be using file server before going there. I will let me quickly walk through what it is and why how you can use this thing. So it is basically an file sharing application which I developed and it do have two kind of users. One has a role Huey or we can say tester and another has a role I named that as developer. You can name it anything else. So basically the person or the user with the Huey role have access to upload and to download and replace to perform all three operations. But the user with access like the user with another role can only download the files. So you can like update the same to the config file as well. Now usually file server support every kind of files you wanted to upload. But for my use cases I have set it default to XML and the GZ format. But this can be again modified through the config file. The application is based on Python's class module and again it has three major interfaces to interact with. It has a web user interface. Sorry to interrupt weapon. Could you please make your font size a bit larger? Okay, okay, sure. Is it visible now? Is it okay, Vishal? I'm assuming that yes. It looks good. Thank you. So it has a pretty good web user interface. You can interact with it through the browser and perform all the operations. Then it has some APIs written. You can hit them as well through any applications like Postman or from anywhere. And it has a command line interface as well. So you can directly integrate it in the automation script to pass your logs to the file server. And here is a simple use case which my team uses because in my case we have multiple teams working across the globes. And we do need to some testing logs or some other kind of files with the developers or with the support people. So we just upload the files here and exchange them among the organization. The another use which we are using is that there are some automation scripts which are Jenkins do and that do generate some kind of JUnit logs or XML logs. So all those logs can directly be uploaded to the server through the command line tool which we have. So now by the time we have successfully or I would say know that what it is, how can be the use cases for this server. Now let's quickly check out the deployment steps. It's really easy. I have written these scripts. All you have to do is copy paste the script. It will work perfectly on reddit based operating system specifically on Fedora. But you can just update the package manager and you will be good to go with Ubuntu or other finished destroy you are using. You can run the same as a container as well. I have Docker file already written. All you have to do is prepare your container image and you can execute the same like either you will be using Portman or Docker. So it's I can say it's supported on Windows as well if you are using Docker or Portman. You can like virtually create volumes. Like if you are deploying the same on your AWS, GCP, OpenStack, OpenShift, Kubernetes cluster, you can attach virtual volumes to the same. And you will be good to go. You can check out the Docker file as well. Just simple steps work the port opening and executing the commands. So once you are done with the scripting or like deployment step, you will be seeing this WebUI on the port 5000. So you can again update every setting through the config file. Default class uses port 5000 and I'm also using the same. So I have done all the steps right here. I have copied the script and pasted here. Install Python 3 and Git. Cloning the repo. Again, moving the database, installing the requirement files and I'm ready to hit the run.py command. And once you started the file server, you will be seeing everything on the WebUI that it has. So you will be seeing what are these products, one product, two products, three and X and Y. Other info. So file server has some code in the backend that validate that it has a config.py file and it makes sure that it has a config dir names directory and it pick this directory and create exact folder structure in the backend on the system so that you can easily upload files through the UI. If your product has sub-product, if it has some kind of categories, some sub-categories. So if the product is not that much complex, you can easily just pass the sub-category or just the sub-product version and all. Product versioning is being taken separately because I just don't want any kind of mess in the above dictionary. So I have just created the separate. Again, I have created this Python list that so if you let's say if you want file server to be support PDF files, you can just add PDF spring here and it will start supporting that as well. So it's all up to you how you wanted to use that. So let's say I have a product named as Python and it doesn't have any sub-product or categories and let's say I just want to add Python Pune and Python Jaipur as its sub-category. So as I have changed the directory structure, so let me quickly stop the server and do the changes for you. Let's config.py. Let's restart the server again and now if you refresh the web UI, you will be having a product named as Python. So again, if you change the directory structure, there will be no data loss if you remove the product later on. But if you want it only to the product, like only product one and Python should get listed, you have to edit the config file first and then hit the command. So it has the product already added. So for downloading, again, I have to register. Let me just create a user. I am using password as test as of now. Again, this is the option. If you select this one, you will be having upload like every permission kind of an admin. If you are not selecting this, you can only download the files. Now, if you hit Python, you will be having the product version, which is right here, 0102. Click on any version, you will be having the category or whatever you write in the config DIR. As of now, we do not have any file, so it will show an empathy page. Now, we have like just the home URL listing all the products. Again, if you will be clicking on specific directory, it will keep on changing it in the similar way, the way you are doing it. Then in the about page, so about page is completely dynamic. Whatever you written in the readme.md file will get automatically converted from markdown to HTML and will get displayed in the about page. So you do not have to go on GitHub every time to check which are the options for the APIs, what are the steps for set up CLI and all. Account has the usual features, changing username, email, uploading profile pictures, log out the name itself says upload. You can basically again patches this config DIR only and show you the exact similar values for uploading the file. We have only two products similarly, so has category 4, it has only one subcategory. It keeps on changing accordingly. So there is one I would say bug or like the thing is missing that if I put this value blank, it will display an empathy string. So I'm kind of working on this writing none or anything like that. But whatever you select here will directly get uploaded. Let's say I want to upload this XML file and it's perfectly uploaded. So I did it on Python. I guess version one. Did I upload it on Pune? I selected the zero to product version and right here you will be having your file. So by default it said that you have to, it has to download every file. But there again a flag or I would say a parameter in the config.py file that can be used if you want files to be directly opened in the file server itself. I replace feature basically allows you to replace any kind of file. So as of now we have only one file named as test.xml. It will just put that file only in the dropdown. If you select any other file, it will replace the same with the specific file. So that's pretty much we have for the web user interfaces. Now let us quickly move ahead and check out the APIs which we have. So I have Postman already up and running here. So I have like deployed the server on this post whose IP is 10.65.211.20 whatever the IP is. And if I hit, so we have three APIs as of now download, upload and replace. Let's say I add in the URL and hit the download API. It will list whatever we have in the homepage just written everything in the JSON format. Now let's say I want to check out whatever the file sort of infrastructure we have. Are you sharing your screen because it's basically blank? Oh yeah, actually it is sharing. Actually I guess I have to move some of the features. Just a second, let me share another screen. Is the Postman web UI visible to everyone? Yes it is. So here you can again specify a specific product, let's say version 0 to N, hit the API to fetch the results. Let's say I want to go for sub-product Python Pune. It will list all the files which we have. Now let's say if you want to download the specific file, all you have to do is give the file name, test1.xml and it will download the file for you. As of now I have written only this text in the test file. So you can save the response or use it any way you want it to. Now let's say you want to use the upload API. So all you have to do is replace the download with upload and all the parameters are same for this API as well. All you have to pass the file. It will be a file option. Let's say test2.z, integration, basic and again. So the file is being successfully uploaded. You can check the same on the web UI and on the command line. Similarly, the replace API, all you have to pass the parameter, you will be, oops, the file is being replaced, I guess. So you just have to hit the API and you will be good to go. I have passed that replace this file with this one. So that's pretty much for the API thing. So all the parameters are well documented here. You can use these much of parameters according to your structure. Similarly, to set up the CLI, you have to hit this command. So it basically creates a file named as file server under this user bin section. So file server command line is as of now not supported on Windows because I am still struggling in figuring out how I can create the .exe package for the same. Once you are done with the CLI setup, all you have to do is check this variable fshost and update its value because by default it's set to localhost. Again, I think my screen won't be visible to you. Actually, I'm not sure why it's not directly asking me to, let's say, a single display. I have to every time change the, is the terminal visible to you all? Yes, it is. So you have to hit the command to set up the CLI. Then you have to edit this option value fshost. So default, I have set it to localhost because I'm testing it there only, but if you haven't posted it on another server, you can upload it. And I guess you are ready to go for the API as well. So sorry, for the command line as well. Now you will be having these three commands, upload, download, or replace. You can hit any command. Again, I have to pass the credentials. So there are two ways of passing credential. Either you can use hyphen capital T, hyphen hyphen password, or you can export them as environment variable. Password is test. And I have set the username as repeat comma. So if you do not pass any options, it will just start listing. So basically it's hitting the APIs in the backend and showing the same responses here. So similarly, you can check out all the APIs. I have all the examples written in the readme.md file. Let me get back to the browser. So help for the specific command you will be having. If you just hit the download, it will list all the products. If you specify the product name, it will list all the versions under that. If you pass the version, it will list all the subproducts. If you pass the category. So similarly, more options you will be passing, it will keep on showing you the list. If you doesn't have any file on the specific parameters, it will return a blank list. If you have specific files, it will list all the files. To download the file, you have to pass the hyphen F or hyphen F file to download the files. So it's pretty easy. You can do the same on your own if you want to. Similarly, for the upload, you have to upload and download have the same option. In case of download, you have to specify the file name you want to download. Or in case of upload, you have to pass the file name you wanted to download. For the replace, things are a bit different. So let's say you do not know which other versions supported what are the things written in the config DIR. So if by mistake you pass some wrong values, it will list you all the supported structure for you on the file itself. For the command line, we have three options, which is let's say hyphen, hyphen, old file and hyphen, hyphen, file name to which you want to replace the same. Let's say you want to replace file one with file two. You can directly hit it. So let's say it has file one located on these five places. So you have to pass the file number from the command line, which is the file number you wanted to replace. Let's say I want to replace this one. So I have passed this parameter right here, file number, file. Then what are the customization you can do in the file server? So let us quickly check out the config file now. So I'm pretty much sure now you know what config DIR is. Whatever structure you input here will get automatically created on the server and the file server respond accordingly. Then we have product version. So for specific product, you will be having a product version. Like I have created a product Python. It has version 0102. You can minimize it accordingly. Then let's say supported extension. I have added XML and GZ by default. If I wanted to add that file server should support .pdf. You can add comma, double course PDF. It will start supporting the PDF files. Now result based DIR. So basically this is the part where file server create this structure. So you can modify this accordingly. Now open in browser. This is basically a setting. So let's say .pxd, like .x file, .load file, .pdf files, .xml files. These are some of the files that can directly be opened in the browser and can be seen. So if you set this option to true, it will start opening the file in the browser itself. If you want that everyone has to just download the file, nothing will be served from the file server. You can keep these two folds. Then create file structure. Let's say you do not want to use all these options. Like do not want to use file server for the specific product. Or let's say you just want to see your VM file server, your system file server on the browser. You can set this option to false. It doesn't create any structure for you. It will just start listing whatever you have on the specific part on the browser. You can still download them. Port number, again, you can upgrade whatever port on which you want to run the file server. You will be good to go. Allow registrations. Let's say in your team, you have 10 people working and you have created accounts for everyone. You do not want any more registrations, any more user registration. You can set these two folds and you will be good to go. So for the updates, like I have this container running here on the same server. Let me show you the docker file. So here I have like the port I triple zero running. Let me quickly show you the corn file actually. Let's say I have added only version 01 here. Again, I say is that I keep the property list as blank. So if you keep it blank, it starts supporting every kind of file. You can upload any extension here. And the result here, I have set to root partition, opening browser set to true config structure. So basically what I have done here is that you are not going to create any kind of structure. You will be running on port 8080 and no registration will be allowed. So I have this container running right here on port 8080. And if I hit the URL, we will be seeing that OX5. So this is everything is coming out from the container. It will just displaying the file system on the UI. It isn't doing anything. So on the container, I have the file server. I have the requirement of TXT. So it started opening the file instead of downloading the 10. Let's say I want it to download file not open. So all you have to do is set this field to false. It will automatically restart the container and it will start giving you options to download instead of opening. So yeah, this is all I have as of now for the customization. So any kind of development on the file server is being only supported on GitHub only. You guys can create issues if you want a new feature to be implemented. So I have these much of features for bugs. So this is something which requires JavaScript. Anyone who is good in JavaScript please take this, I would say. Feel free to contribute. And yeah, that's all I have for file server. I am up for questions now. Great. Great. We've been great talk. Great project by the way. I have seen this growing. So they're like pretty great improvements and features being implemented by you from the last time. So it's really great. So we have further questions. So anyone having any queries please do post your questions in the Q&A section. I think we've been using it in your team, right? Yeah, I'm using it in my team since I guess nine or 10 months now. And it hasn't been. Production ready system then. Yes. It's within certified. Great. So hopefully you have taken a great session. I guess so people are not having much queries yet. We are still waiting for a few queries. And also after after the session, if someone wants to collaborate with weapon to just discuss on this or have some networking things. So we are going to also paste a Julep chat where you can get connected with the speaker for this session. So I have like say, I will be saving the PPP. You will have in all the documentation you are else and everything. If you want to bring your clients, you can check out the social handles. And yeah, I guess if no question, then I finished two minutes early. Great. So yes, we have a couple of questions. And I'll just cater it to you. Give me a moment. So the first question is, is pagination support in API? If file count is high, as of now, not because like in my case, we have a release in each, I would say month or two months. So there is not that much number of files. But if you want a feature, you can just create a GitHub issue. I will start working on it right now. Great. That answers. So maybe I'll move on to the second question. That is, how would we work with latch files that requires comparison? So what I'm understanding is, are you like asking the limit that it can accept for the uploading of that kind of thing? Yes. Okay. So it depends on your system. Like I'm using an eight-heat of RAM system for the same. So I can easily upload files up to four or five gigabytes. So it's on your system how much RAM you have.