GithubHelp home page GithubHelp logo

ycheng / gcp-tools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from canonical-labs/gcp-tools

0.0 0.0 0.0 11 KB

Scripts to simplify interacting with Google's GCP in a prescribed manner.

License: Apache License 2.0

Shell 100.00%

gcp-tools's Introduction

Introduction

The following sections assume you have signed up for google cloud. If you haven't done this step, please visit the gcp signup page. You can start for free.

GCP Setup Instructions

You can run these instructions from your own terminal, or using the GCP shell. The GCP shell is accessed through your browser, from the GCP dashboard, as described below.

  1. Please create a project
  2. You'll use this project id for the commands in this directory
  3. If using a local terminal / shell:
  4. Please install gcloud: 1. Visit the interactive install page 2. Ensure you run gcloud init
  5. Otherwise, you can use the gcp shell in your browser.
  6. Navigate to the gcp dashboard
  7. Select the >_ image in the upper right part of the top level tool bar
  8. NB: you get do a git clone of this project inside the cloud shell

Creating a VM

From this directory, you should run the following commands to create the initial VM and ssh in. It is important that you set the project id first, there are sensible defaults for everything else:

export GCP_PROJECT=<the Project Id of the project you created>

# This creates a firewall rule that allows any IP address to access certain ports
./network_create.sh

# This will create a VM instance, with the firewall rule applied
./compute_create.sh

# This will log you into the VM, once it is up and running.
./compute_ssh.sh

Stop / Delete / Start

For ongoing use, you can stop and start anytime. When you are completely done, please delete the VM.

You don't pay money for the VM when it is stopped, but you do pay for the attached disk (for what has been used).

# If you haven't already, create GCP_PROJECT ..
export GCP_PROJECT=<the Project Id of the project you created>

# To stop a running VM
./compute_stop.sh

# To start a stopped VM
./compute_start.sh

# To delete a VM (in any state)
./compute_delete.sh

gcp-tools's People

Contributors

carmine 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.