Giter Club home page Giter Club logo

cs162-workspace's Introduction

๐Ÿซ˜ CS162 Workspace ๐Ÿซ˜

Introduction

Welcome to the CS162 Workspace, a Docker-based environment for CS 162! This image is designed to provide a standardized development environment for students regardless of host architecture or OS, without the hassle of VPN'ing into an instructional machine.

Prerequisites

Docker is a cross-platform tool for managing containers. You can use Docker to download and run the Workspace we have prepared for this course. The Workspace for the course may undergo significant changes every term; do not use one from a previous semester.

First, you will have to download and install Docker to your machine so you can access the Workspace. This can be done in one of following two ways.

Getting Started

Lucky for you, we have already built the image for both ARM and x86 machines (hosted on Docker Hub)!

After Docker has been installed, type the following into your terminal to initalize the Docker Workspace and begin an SSH session. These commands will download our Docker Workspace from our server and launch it. The download of the Workspace will take some time and requires an Internet connection.

Note: Docker commands will generally have to be run with sudo access, so for the commands below you might need to use sudo docker-compose up -d.

  1. Clone this GitHub Repository

  2. Navigate to the Repository

    cd cs162-workspace
  3. Run Docker Compose for the first time

    docker-compose up

    This command will build and start the Docker container defined in the docker-compose.yml file. If needed, you can change the port used for SSH within this file.

    Wait until you see "Docker workspace is ready!" in the terminal. The Workspace is now ready (obviously ๐Ÿ™„).

    Use Ctrl + C to stop the command.

  4. Starting the container in the background

    docker-compose up -d

    This will simply start the container in the background and keep it running. With Docker Desktop, you can also manage this through the GUI.

  5. SSH into the Container

    ssh [email protected] -p 16222

    Use the password workspace the first time you SSH into the container.

  6. Stop the container

    Within your host machine's shell (not the Workspace shell you ssh'd into):

    docker-compose down

    This will stop the container. Your data should still be saved within the hidden .workspace folder, so you can restart the container as needed and pick up where you left off.

    Note: To be safe, always push work you want to keep to Github!

    Use with caution: If you ever need it, you can use sudo rm -rf .workspace to reset the Workspace.

Avoiding Password Entry

To avoid entering the password every time you SSH into the container, follow these additional steps from your host machine:

  1. Copy Your SSH Key

    ssh-copy-id -p 16222 -i ~/.ssh/id_ed25519.pub [email protected]

    Replace ~/.ssh/id_ed25519.pub with the path to your SSH public key.

  2. Update SSH Config To alias the full SSH command, add the following lines to your ~/.ssh/config file:

    Host docker162
      HostName 127.0.0.1
      Port 16222
      User workspace
      IdentityFile ~/.ssh/id_ed25519
    

You can now enjoy a passwordless SSH experience for your CS162 workspace: ssh docker162

Happy coding!

(OPTIONAL) Updating the image

You only need to do this if staff push changes to the image. We will let you know if/when this happens.

You may need to update the image if changes are pushed. You could completely reset your workspace by deleting the .workspace directory. However, we provide a mechanism to safely update by tracking changes with git.

  1. To be extra safe, push anything you want to keep to Github first.

  2. Pull the latest image from Docker hub with docker image pull cs162/pintospace.

  3. Stop and remove the old container. You can do this through the Docker desktop GUI or the command line via docker stop CONTAINER_ID && docker rm CONTAINER_ID. You can find your CONTAINER_ID through docker ps -a.

  4. Run docker-compose run -i cs162 and follow the instructions to update. You can exit out of the shell with exit once it's done.

  5. You're done updating! You can go back to the usual way of starting the container.

Building From Source (OPTIONAL and not recommended)

Local build:

Simply run docker build .

For staff:

If you would like to deploy changes to Docker Hub for ARM and x86, first sign in with the cs162 account and run the following buildx command:

docker buildx build --platform linux/amd64,linux/arm64 -t cs162/pintospace:latest --push .

cs162-workspace's People

Contributors

shreyaskallingal avatar potatoparser avatar jel221 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.