From 19016dcc54598571df28ed4809178c4ae57decc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Tue, 26 Apr 2022 21:04:26 +0200 Subject: [PATCH] Revert "GitHub Codespaces: Add `devcontainer.json` files to Livebook (#1138)" This reverts commit caeb23fe4897bfb5c41e408f0e34a51e4a291b56. See the discussion in #1138. --- .devcontainer/Dockerfile | 46 -------------------------------- .devcontainer/devcontainer.json | 27 ------------------- .devcontainer/docker-compose.yml | 19 ------------- README.md | 9 ------- 4 files changed, 101 deletions(-) delete mode 100644 .devcontainer/Dockerfile delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .devcontainer/docker-compose.yml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 4de8204b2..000000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,46 +0,0 @@ -# This image version needs to match what is in the root Dockerfile. -FROM hexpm/elixir:1.13.2-erlang-24.1.7-debian-bullseye-20210902-slim - -ENV HOME=/home/livebook -ENV PATH ${PATH}:${HOME}/.mix/escripts - -# GitHub Codespaces put you in a `/workspaces` folder no matter what. -ENV WORKSPACE_FOLDER=/workspaces/livebook - -WORKDIR ${WORKSPACE_FOLDER} - -# Install the dependencies from the build image (which is discarded in the normal production images) -RUN apt-get update && apt-get upgrade -y && \ - apt-get install --no-install-recommends -y \ - # Bash (for easier shell use) - bash \ - # Runtime dependencies - build-essential ca-certificates libncurses5-dev inotify-tools \ - # In case someone uses `Mix.install/2` and point to a git repo - git \ - # Additional standard tools - curl wget \ - # In case someone uses Torchx for Nx - cmake && \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false && \ - apt-get clean -y && \ - rm -rf /var/lib/apt/lists/* - -# Install hex and rebar -RUN mix local.hex --force && mix local.rebar --force - -# Node/nvm setup -ARG NODE_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/script-library/node-debian.sh" -ARG NODE_SCRIPT_SHA="dev-mode" -ARG NODE_VERSION="14" -ENV NVM_DIR=/usr/local/share/nvm -ENV NVM_SYMLINK_CURRENT=true -ENV PATH=${NVM_DIR}/current/bin:${PATH} - -RUN curl -sSL ${NODE_SCRIPT_SOURCE} -o /tmp/node-setup.sh && \ - /bin/bash /tmp/node-setup.sh "${NVM_DIR}" "${NODE_VERSION}" "${USERNAME}" - -# On Codespaces the code is automatically copied and we run the setup as a hook, -# we still do this for the image, so the container can be tested on its own -COPY . . -RUN mix do dev.setup, deps.compile, compile diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index b42291eb9..000000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,27 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. -// Also see https://github.com/microsoft/vscode-dev-containers/tree/v0.231.6/containers/elixir-phoenix-postgres -{ - "name": "Livebook development environment", - "dockerComposeFile": "docker-compose.yml", - "service": "livebook_dev", - - // Despite being required to set workspaceFolder, it doesn't actually do anything and you end up in /workspaces/livebook no matter what. - "workspaceFolder": "/workspaces/livebook", - - // Codespaces will mount the source code and overwrite the build artifacts that the Dockerfile creates, so we rebuild with a lifecycle script. - "updateContentCommand": "mix do dev.setup, deps.compile, compile", - - "extensions": ["jakebecker.elixir-ls"], - "forwardPorts": [4000, 4001, 8080, 8081], - "otherPortsAttributes": { - "onAutoForward": "ignore" - }, - "settings": { - // Needed because of: https://github.com/microsoft/vscode/issues/102057#issuecomment-657728467 - "debug.javascript.autoAttachFilter": "onlyWithFlag", - "debug.javascript.autoAttachSmartPattern": [ - "!**/node_modules/**", - "**/$KNOWN_TOOLS$/**" - ] - }, -} diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml deleted file mode 100644 index f70f72033..000000000 --- a/.devcontainer/docker-compose.yml +++ /dev/null @@ -1,19 +0,0 @@ -version: "3.8" - -services: - livebook_dev: - container_name: livebook_dev - image: livebook_dev:latest - build: - context: .. - dockerfile: ./.devcontainer/Dockerfile - environment: - - LIVEBOOK_HOME=/data - - LIVEBOOK_DATA_PATH=/data - # Overrides default command so things don't shut down after the process ends. - command: sleep infinity - ports: - - "8080:8080" - - "8081:8081" - - "4000:4000" - - "4001:4001" diff --git a/README.md b/README.md index 320689dcc..5ad1bc264 100644 --- a/README.md +++ b/README.md @@ -126,15 +126,6 @@ If you want to run Livebook on embedded devices, such as Raspberry Pi, BeagleBon check out [our Livebook firmware](https://github.com/livebook-dev/nerves_livebook) built with [Nerves](https://www.nerves-project.org/). -### GitHub Codespaces (development) - -Livebook also has a `devcontainer.json` file for launching containers -on [GitHub Codespaces](https://github.com/features/codespaces) for development -purposes. Once booted, you can invoke `mix phx.server` in the terminal to start -your own Livebook session. - -Check [the official GitHub Codespaces documentation](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace#creating-a-codespace) to learn more. - ## Security considerations Livebook is built to document and execute code. Anyone with access to a Livebook instance