TODO: Replace with your team members
One person needs to follow SETUP.md to complete setup. Ignore this if it is already done for you!
In GitHub, go to your team's repository. Click on "Code" then on "SSH" and copy the output.
Open Cloud Shell by going to https://shell.cloud.google.com. Make sure you are in the correct Google account!
In the terminal, type git clone and then paste what you copied from GitHub. You should see something like this, with your GitHub org and repository name:
git clone [email protected]:Github-Org-Name/my-team-repository.gitHit enter, and then use cd to change into your team's repository.
cd my-team-repositoryRun this command in the terminal to install the needed packages.
pip install -r requirements.txtRun the following command to run the app locally. Follow the URL that is outputted, or in the Cloud Shell Editor, go to the upper right corner and hover over the icons until you find "Web Preview". Then click on "Preview on port 8080." You should see the app!
streamlit run app.pyNote: When you make changes, you just need to refresh the webpage and the new changes should appear (you do NOT need to rerun the previous command while you are actively making changes).
Docker simply creates a virtual environment for only your app. This is what we will use to deploy our app continuously.
Fortunately, we already have a script that builds and starts Docker for us. Run the following command to build the container and start the server locally.
./run-streamlit.shNote: This also outputs the same local URL that the previous command output. The only difference is that instead of running the webapp on your Cloud Shell, it is running it within a Docker container. Don't worry too much about understanding this now, but if this command fails, your automatic deployment through GitHub Actions will also fail.
First, make sure someone in your team has gone through the steps in SETUP.md. Make sure you have Owners permission on the GCP project in IAM.
Run the following command to deploy your webapp.
./manual-deploy.shAfter you are assigned a task in the project, how do you actually make the changes and test them out? Follow these steps:
- Change into your team's repository in Cloud Shell using
cd. - Run
git pull --rebaseto pull in any of your teammates changes. - Make changes to the code in Cloud Shell Editor.
- Run
streamlit run app.pyto see the changes in action (Step 2 above). Don't use CTRL-C and let this command continuously run. - Continue to make changes and refresh the web page with the app to see the new changes.
- When you are ready to be done, use CTRL-C to stop the
streamlit runcommand. - Check that your changes work in a container by running
./run-streamlit.shand make sure you see your changes. - Use git to add, commit, and push your changes. It might be good to run
git pull --rebasebefore pushing your changes, or optionally use git branches to avoid conflicts with your teammates. - In GitHub, once you push to the main branch, check that the Actions succeeded and deployed your changes.