Giter VIP home page Giter VIP logo

dev-on-chromeos-gce-setup's Introduction

Setting up this instance

Why

Because:

  • I work on a Chromebook (it's generally awesome, except for local development)
  • Running a (premptable) big server for even 40 hours a month is much cheaper than buying a good dev workstation
  • It forces me to make things as simple as possible, which means lower barriers to entry to anyone who wants to help.

Disclaimer

This is not an official Google product.

Key steps to set this up

Basic setup

GCE Ubuntu 16 comes with curl and git and bash. If you don't have those, add them.

External IP / Synamic DNS integration

Preemptable instances habe ephemeral external IPs - the IP goes away when the instance is shut down.

To make it easier to use, use a dynamic DNS service - like DuckDNS (which is free).

To setup DuckDNS - get the Curl URL from your DuckDNS page, and put the hostname and the token in /etc/duckdns.env. It should look like this, but with your values:

DUCKDNS_HOSTNAME=myserver
DUCKDNS_TOKEN=01234567-89ab-cdef-0123-456789abcdef

Then set up the service:

sudo cp duckdns.service /etc/systemd/system
sudo systemctl enable duckdns.service

In case you want to check the IP from the machine itself:

curl http://metadata/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip -H "Metadata-Flavor: Google"

Install Docker

Install the Docker repos and Docker, which are generally much more recent than the Ubuntu maintained docker.io package:

sudo apt-get -y install \
  apt-transport-https \
  ca-certificates;
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - ;
sudo add-apt-repository \
       "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
       $(lsb_release -cs) \
       stable";
sudo apt-get update;
sudo apt-get -y install docker-ce;
sudo service docker restart;

Add your user to the docker group - makes life easyier:

sudo gpasswd -a ${USER} docker

Thin logout and log back in.

Install docker-compose

A script to just get the latest non-rc version of docker-compose:

./get-dc.sh

Setup an ssh key

Because you're on GCE (just guessing...):

ssh-keygen -t rsa -C "${USER}@gmail.com" -b 4096
cat ~/.ssh/id_rsa.pub

Add the public SSH key to your code repo of choice.

Setup GIT

Let git know who you are:

git config --global user.email "your-email-addresss-here"
git config --global user.name "your-name-here"

Auto Shutdown

If you want to automatically shutdown the server instance so you're not charged for time you're not using:

sudo cp auto_shutdown /etc/init.d
cd /etc/rc3.d
sudo ln -s /etc/init.d/auto_shutdown S99auto_shutdown

dev-on-chromeos-gce-setup's People

Contributors

asacamano avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.