App Deployment
Navigate to Deploy section from left-sidebar on the platform.
Click on ‘App Deployment’, present on top right corner.
Now, Fill in your app details in the dialog box and Select your Environment/framework you want to create your apps with.
The Platform currently supports:
Streamlit
Dash by Plotly
Gradio
Note: Always define the route as given below with custom Host and Port in all your applications:
import os
route = os.environ["ROUTE"]
# For Dash Application
app = dash.Dash(url_base_pathname=route)
app.run_server(host="0.0.0.0", port=8050)
# For Gradio Application
app.launch(root_path=route, share=False, server_port=8050, server_name="0.0.0.0")
GitHub Token: Enter your GitHub token. To learn how to access your token, click on the ‘?’ icon. Alternatively, you can also follow the Minimal Permission guide for Token link to do the same.
Username: The username is automatically fetched once you provide your GitHub token.
Account Type: Select your ‘Account Type’ as either ‘Personal’ or ‘Organization’ depending on where your application resides.
App Visibility: Select either 'Public' or 'Private' based on the accessbility of the app.
Repository: Select the repository where your application is stored.
Note: Your repository should contain app.py and requirements.txt files.
Revision Type: You can either deploy the app using branch or tag.
Branch: Select your branch from the dropdown.
Note: Platform supports the fetching of application code only from master branch. So make sure you have updated your master branch with your latest app code.
Tag: Select tag for which you want to deploy your app.
Main file path: Select your main file path (usually your app.py file) through which your app could run.
Python Version Select the appropriate python version of your app from the dropdown.
Autoscaling: Enable or Disable the app based on the load on the application.
Resources:Select the cluster size of the resources required for running your app from the dropdown.
Environment Variables: If your app uses any environment variables, then you need to supply those during deployment. Click on the Add Environment Variable option. In the deployment interface you see Key Value space, pass the key variable same as the one used in the app and it's respective value. Click on +. You can add any number of key value pairs but make sure you save them first before adding a new pair.
Proceed to click on Deploy.
After successful deployment of the app, you will be able to view your deployment in the Deploy section. The app will be ready to launch once it is in Running state.
If you have deployed through branch option so, the deloyed app will display the branch name information as below
Else if the app is deployed through tag option, tag information will be displayed on the app as below.
To launch your app, click on App URL.
A pop-up will appear with the button showing click here by clicking it, you can open the app.
The app will launch in a new tab.
You can also modify the resources for your app by clicking Edit on the app deployment panel. You can either change the python version or increase/decrease the resourcer or scale up/down as per your requirement.
You can check the logs of the App which are deployed and in running state by clicking the
Logs
icon. Pop up will appear to show the logs.You can also check the CommitId option available on app information, to make sure your app is synced with the latest commit.
Env Vars will display the information of the all environment variables you passed during deployment. If you have not passed any environment variables, then this option will not be available.
Delete the app which is not in use by clicking the red bin icon. Pop up will appear and ask the confirmation for deleting the app. Click Delete.