Getting Started - AndersenLab/CAENDR GitHub Wiki
This page describes how to install all the required software to run CaeNDR locally.
NOTE: This project was developed on MacOS, and as such this documentation will focus on Mac.
Note: Once you have set up the project, please consult the page External Resources for documentation on the tools & software we use to build the site.
To authenticate with the Google Cloud services used by this project, you must use a service account credential JSON file.
-
Obtain the JSON file for the relevant service account and GCP project, if one exists - ask your team about this. If one does not exist yet, you'll need to create a new service account.
- If you have the content for the JSON file, but not the filename, create a JSON file with a name matching the ID of the GCP project you're working in. Importantly, this MAY NOT be the same as the project name! For example, if you are working in a project named
sample-gcp-project
with an IDsample-gcp-project-12345
, then you should name the JSON credentials filesample-gcp-project-12345.json
. - NOTE: Some existing credentials files have an additional string of numbers at the end - this is okay! For example, you might receive a JSON file named
sample-gcp-project-12345-0987654321.json
- don't worry about this.
- If you have the content for the JSON file, but not the filename, create a JSON file with a name matching the ID of the GCP project you're working in. Importantly, this MAY NOT be the same as the project name! For example, if you are working in a project named
-
In your local file browser (Terminal, Finder, etc.), navigate to
~/.gcp
under your home directory. If this folder does not yet exist, you will need to create it:# Create the GCP credentials folder mkdir ~/.gcp # Optional - open the current location in Finder (MacOS) open -a Finder ~/.gcp
-
Add / move the service account JSON file to the
.gcp
folder.
A list of applications used for development, along with download & app-specific setup instructions.
- Download from https://code.visualstudio.com/
- Install the following extension(s):
- "Python" (should have 96M downloads)
- Download from https://docs.docker.com/get-started/get-docker/
-
Install Homebrew using cURL on the command line:
cd $HOME mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
-
Find out which shell you are using:
echo $SHELL
If you see "bash" then update the
~/.bash_profile
in the next step. If you seezsh
as your shell, then update the file~/.zprofile
-
Add this line to the bottom of your file
~/.bash_profile
, or.zprofile
, as determined in the previous step:export PATH=$HOME/homebrew/bin:$PATH
Setup requires make
which can be installed with:
sudo apt-get update && sudo apt-get install build-essential
This appears to be a holdover from a (much) earlier stage of the project, and may or may not be relevant on modern devices. If your terminal puts out the correct result for the final step, you may be able to skip this.
- Open Finder on your Mac
- Navigate to
Applications/Utilities/Terminal.app
- Right-click "GetInfo"
- Enable the checkbox "Open with Rosetta"
- Close and reopen the Terminal app
- Inside Terminal, type:
Expected result:
arch
i386
Installing the project software dependencies.
-
Make sure to install Homebrew on your machine (instructions above).
-
Update Homebrew to the latest version & install the dependencies.
arch -x86_64 brew update arch -x86_64 brew install pyenv OpenSSL readline gettext xz
-
Edit your
~/.bash_profile
and add this to the bottom of the file. If the file~/.bash_profile
doesn't exist, check if you are using a different shell (eg: zsh, etc); in that case, you might need to edit the file~/.zshrc
or~/.zprofile
instead.-
Determine whether to use
.bash_profile
,.zprofile
, etc. -
Open your file in the text editor of your choice, e.g.:
# if using Vim as a file editor on a bash terminal, then do: vim ~/.bash_profile # if using Nano as a file editor on a zsh terminal, then do: vim ~/.zprofile # etc etc
-
Add the following lines to the bottom of the file:
export PATH=$HOME/.pyenv/bin:$PATH eval "$(pyenv init --path)" eval "$(pyenv init -)"
-
Re-apply your profile.
# if using bash, then do: source ~/.bash_profile # if using zsh, then do: source ~/.zprofile # etc etc
-
-
Install PyEnv and VirtualEnv requirements with the correct versions.
pyenv install 3.7.12 pyenv global 3.7.12 pip install virtualenv
Expected Outputs:
$ python -V Python 3.7.12 $ virtualenv --version virtualenv 20.13.0 from /Users/rbv218/.pyenv/versions/3.7.12/lib/python3.7/site-packages/virtualenv/__init__.py
To automatically install system package requirements for development and deployment:
make configure
To configure your local environment to use the correct cloud resources, you must set the default project and credentials for the Google Cloud SDK and define the 'ENV' environment variable:
gcloud init
gcloud auth login
gcloud auth application-default login
gcloud auth configure-docker
export ENV={ENV_TO_DEPLOY}
To list all available MakeFile targets and their descriptions in the current directory:
make
or
make help
Once you have set up the project, please consult the page External Resources for documentation on the tools & software we use to build the site.
???