Skip to content

Instantly share code, notes, and snippets.

@edcote
Last active May 5, 2018 02:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edcote/e4e632cc304e6796889c52a823404958 to your computer and use it in GitHub Desktop.
Save edcote/e4e632cc304e6796889c52a823404958 to your computer and use it in GitHub Desktop.
Google Compute Engine

Google Compute Engine

CONSOLE

HOWTO

Cloud SDK install

For Ubuntu:

export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo apt-get update && sudo apt-get install google-cloud-sdk

Firewall

Firewall

Dynamic DNS

support information here

sudo apt-get install ddclient

see: domains.google.com for login information

Login

Connect .. select 'View gcloud command' ..

gcloud auth login
gcloud compute --project "lithe-sunset-160819" ssh --zone "us-central1-c" "instance-1"

Copy file from instance

gcloud compute \
--project "lithe-sunset-160819" \
scp instance-1:/mnt/disks/disk-1/riscv-tools/riscv.tar.gz . \
--zone "us-central1-c"

or through scp -rp edc@35.224.172.xxx:~/tmp/rsyn-x/* .

Machine bootstrap

Install NADE

export RISCV_CI=/opt/riscv-ci
sudo mkdir -p $RISCV_CI
sudo chgrp google-sudoers $RISCV_CI
sudo chmod g+w $RISCV_CI
cd $RISCV_CI
git clone https://ecote@bitbucket.org/ecote/nade.git

sudo echo "export RISCV_CI=/opt/riscv-ci
           export NADE_HOME=/opt/nade
           export PATH=$NADE_HOME/scripts:$PATH
           nsh" > /etc/profile.d/riscv_ci.sh

Install required packages

FIXME

Install Jenkins

wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key > key
sudo apt-key add key
echo "deb https://pkg.jenkins.io/debian-stable binary/" >> /etc/apt/sources.list
sudo apt-get update
sudo apt-get install jenkins
sudo service jenkins restart

Connect to http://:8080 and continue setup manually ...

Install the following plugins:

Mount a persistent disk (manual step)

See: https://cloud.google.com/compute/docs/disks/add-persistent-disk

# search for DEVICE_ID
export DISK=/mnt/disks/disk-1
lsblk
export DEVICE_ID=sdb

# format (be careful!)
sudo mkfs.ext4 -m 0 -F -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/$DEVICE_ID

# initial mount
sudo mkdir -p $DISK
sudo mount -o discard,defaults /dev/$DEVICE_ID $DISK
sudo chmod a+w $DISK

# fstab update
cat /etc/mtab | grep $DEVICE_ID # save line to /etc/fstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment