Also see Handy Links.
-
Install Python and Fireworks:
- Install Python:
pyenv install 3.11.3 - Install a Python virtual environment manager like
virtualenv,pyenv-virtualenv, andpyenv-virtualenvwrapper; orvenv - Create a Python virtual environment in your project directory, e.g.:
pyenv local 3.11.3 pyenv virtualenv myproject pyenv local myproject
- Install the Fireworks pips:
This provides command line tools
pip install FireWorks borealis-fireworks pyenv rehash
lpad,gce, and more.
- Install Python:
-
Install the Cloud SDK tools.
-
Setup Python for the
gcloudandgsutiltools.Note:
gsutil -mis still broken in Python 3.8+ so use Python 3.6 or 3.7. (gsutil issue #961.)Install Python 3.6 or 3.7 if you don't already have one of them, e.g. using
pyenv:pyenv install 3.7.16
Set
$CLOUDSDK_PYTHONin your shell profile:# Set the Python version for Cloud SDK. export CLOUDSDK_PYTHON=$(pyenv shell 3.7.16; pyenv which python)
Then open a new shell (or run this
exportcommand). -
Test the
gcloudtool by running the shell command:gcloud info
If your shell doesn't find
gcloud, add lines like the following to your shell profile file (.profileor.bash_profileor whatever), adjusting them if you installed the SDK somewhere besides$HOME/dev/google-cloud-sdk/.# Update PATH for the Google Cloud SDK and gcloud CLI. if [ -f '$HOME/dev/google-cloud-sdk/path.bash.inc' ]; then . '$HOME/dev/google-cloud-sdk/path.bash.inc'; fi # The next line enables shell command completion for gcloud. if [ -f '$HOME/dev/google-cloud-sdk/completion.bash.inc' ]; then . '$HOME/dev/google-cloud-sdk/completion.bash.inc'; fi
Then open a new shell and retest the
gcloud infocommand.(The second part above adds TAB completion to the shell. E.g.
gcloud c<TAB>should show multiple completions.) -
Run
gcloud components listto see which components are installed. If thedocker-credential-gcrcomponent is not installed [TODO: Do we still need it?], rungcloud components install docker-credential-gcr -
Run:
gcloud init
- If you've created a project and selected a Compute Engine zone for it,
enter those names when
gcloud initasks for a default project and zone.
This will:
- initialize
gcloudand its SDK tools - run some diagnostics
- log in using your user account credentials
- set configuration defaults
Tip: To change settings later, you can re-run
gcloud initor run specific commands likegcloud auth login,gcloud config set zone us-west1-a, andgcloud config set project my-favorite-project.Tip: Detailed documentation is available via
gcloud helpand the gcloud web reference for for gcloud init and the other gcloud subcommands. - If you've created a project and selected a Compute Engine zone for it,
enter those names when
-
Afterwards,
gcloudwill occasionally prompt to install updates. You can do it proactively via the command:gcloud components update
If you want to build and test Docker Images locally on your development computer and/or to run a Fireworker locally, you'll need to install Docker. Without it, you can still run these steps on Cloud Build and Compute Engine servers.
- Install Docker Desktop.
- Optional: Create a Docker ID on their website and Log in to your Docker ID from the Docker client.
- Optional: Set up shell completion for Docker.
Tip: You can exit Docker Desktop when you're not using it.