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
gcloud
andgsutil
tools.Note:
gsutil -m
is 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_PYTHON
in 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
export
command). -
Test the
gcloud
tool by running the shell command:gcloud info
If your shell doesn't find
gcloud
, add lines like the following to your shell profile file (.profile
or.bash_profile
or 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 info
command.(The second part above adds TAB completion to the shell. E.g.
gcloud c<TAB>
should show multiple completions.) -
Run
gcloud components list
to see which components are installed. If thedocker-credential-gcr
component 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 init
asks for a default project and zone.
This will:
- initialize
gcloud
and 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 init
or 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 help
and 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,
gcloud
will 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.