Creating the image used for this exercise - ncbi/workshop-asm-ngs-2022 GitHub Wiki

Some setup was involved in creating the machine image used for this class. The image was based on the stock Ubuntu 20.04 image provided by Google Cloud. Here are my notes on image creation. Note that these have not been tested as instructions and slight variations might be needed to prepare a new image.

WORK IN PROGRESS... Not yet complete

#### VM creation
$ gcloud compute instances create workshop2-ubuntu --project=ncbi-pd-amr --zone=us-central1-a --machine-type=e2-standard-16 --network-interface=network-tier=PREMIUM,subnet=default --maintenance-policy=MIGRATE --provisioning-model=STANDARD --service-account=450674721233-compute@developer.gserviceaccount.com --scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/trace.append --create-disk=auto-delete=yes,boot=yes,device-name=workshop2-ubuntu,image=projects/ubuntu-os-cloud/global/images/ubuntu-2004-focal-v20220823,mode=rw,size=100,type=projects/ncbi-pd-amr/zones/us-central1-a/diskTypes/pd-balanced --no-shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring --reservation-affinity=any

#### ubnutu 2004 LTS 100gig persistant balanced disk otherwise defaults

### After logging in:
sudo apt-get update
sudo apt-get -y install git
sudo apt install unzip

#### personal setup, will need to copy some of it to /etc/skel
git init .
git remote add origin https://github.com/evolarjun/home
git fetch
git checkout main
. .bash_profile
sudo bin/_apt-setup.sh
_setup.sh

#### install RAxML
mkdir -p src/raxml
cd src/raxml
wget https://github.com/amkozlov/raxml-ng/releases/download/1.1.0/raxml-ng_v1.1.0_linux_x86_64.zip
unzip raxml-ng_v1.1.0_linux_x86_64.zip
sudo cp raxml-ng /usr/local/bin

#### install SeqKit
mkdir ~/src/seqkit
pushd ~/src/seqkit
wget https://github.com/shenwei356/seqkit/releases/download/v2.3.0/seqkit_linux_amd64.tar.gz
tar xvfz seqkit_linux_amd64.tar.gz
sudo cp seqkit /usr/local/bin

#### install MUSCLE
pushd ~/src
wget https://github.com/rcedgar/muscle/releases/download/v5.1/muscle5.1.linux_intel64
chmod 755  muscle5.1.linux_intel64
sudo mv muscle5.1.linux_intel64 /usr/local/bin
pushd /usr/local/bin
    sudo ln -s muscle5.1.linux_intel64 muscle
popd

#### install blast+
sudo apt install ncbi-blast+

#### install hyphy
sudo apt install -y cmake
sudo apt-get install -y libcurl4-openssl-dev curl
sudo apt install -y zlib1g
cd ~/src
git clone https://github.com/veg/hyphy.git
cd hyphy
cmake .
make -j MP
sudo make install

#### install AMRFinderPlus
sudo apt-get install -y hmmer ncbi-blast+ curl
pushd ~/src
mkdir amrfinder
cd amrfinder
wget https://github.com/ncbi/amr/releases/download/amrfinder_v3.10.40/amrfinder_binaries_v3.10.40.tar.gz
tar xvfz amrfinder_binaries_v3.10.40.tar.gz
rm amrfinder_binaries_v3.10.40.tar.gz
sudo cp `ls | egrep -v 'test_|version.txt'` /usr/local/bin
sudo amrfinder -u

#### install SRA toolkit
cd ~/src
    wget https://ftp-trace.ncbi.nlm.nih.gov/sra/sdk/2.10.8/setup-apt.sh
    sudo bash setup-apt.sh
    ### Please 'source /etc/profile.d/sra-tools.sh' to setup your path
    ### To configure vdb-config --interactive
    ### Get credentials.json and add them to the vdb-config --interactive
    fastq-dump --stdout -X 2 SRR13013253 # to test


#### Set up environment
Added the following to /etc/skel
sudo cat <<END >>.bashrc

#### Customizations for workshop
export HISTCONTROL=ignoredups
alias ll='ls -ltrF'
export PATH=$PATH:/snap/bin
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi
END

#### install visidata
sudo apt-get install visidata

#### Add d2l and d2f to /usr/local/bin from https://github.com/evolarjun/home
pushd /usr/local/bin
sudo cp ~aprasad/bin/d2l /usr/local/bin
sudo cp ~aprasad/bin/d2f /usr/local/bin
popd

After the server was prepared an image was created using the web console "Create image" button under Compute Engine / Images.

⚠️ **GitHub.com Fallback** ⚠️