From 3a770aea87e2ec9f24ffb314fd809bfc7125c333 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Thu, 26 Jan 2023 17:26:05 +0200 Subject: [PATCH] Revert "feat(dogfood): install nix package manager (#5308)" This reverts commit bfc8a1094b9c078aa404eef3de1fb79cb0f9f92f. --- dogfood/Dockerfile | 21 +-------------------- dogfood/main.tf | 41 ----------------------------------------- 2 files changed, 1 insertion(+), 61 deletions(-) diff --git a/dogfood/Dockerfile b/dogfood/Dockerfile index 75c6424e32ace..52915db09b7d9 100644 --- a/dogfood/Dockerfile +++ b/dogfood/Dockerfile @@ -316,24 +316,7 @@ COPY --from=go /tmp/bin /usr/local/bin COPY --from=rust-utils /tmp/bin /usr/local/bin COPY --from=proto /tmp/bin /usr/local/bin -# Configure Nix without sandboxing -# - https://github.com/NixOS/nix/issues/2636#issuecomment-455302745 -# - https://nixos.org/manual/nix/stable/installation/multi-user.html#setting-up-the-build-users -RUN addgroup --system nixbld \ - && adduser coder nixbld \ - && for i in $(seq 1 30); do useradd -ms /bin/bash nixbld$i && adduser nixbld$i nixbld; done \ - && mkdir -m 0755 /nix && chown coder:coder /nix \ - && mkdir -p /etc/nix && echo 'sandbox = false' > /etc/nix/nix.conf - -# Install Nix -ARG NIX_VERSION=2.3.15 -RUN cd /opt \ - && curl --silent --show-error --location \ - "https://releases.nixos.org/nix/nix-${NIX_VERSION}/nix-${NIX_VERSION}-x86_64-linux.tar.xz" \ - -o "nix-${NIX_VERSION}-x86_64-linux.tar.xz" \ - && tar -xf "nix-${NIX_VERSION}-x86_64-linux.tar.xz" \ - && ln -s "nix-${NIX_VERSION}-x86_64-linux" nix \ - && rm -rf "nix-${NIX_VERSION}-x86_64-linux.tar.xz" +USER coder # Ensure go bins are in the 'coder' user's path. Note that no go bins are # installed in this docker file, as they'd be mounted over by the persistent @@ -349,5 +332,3 @@ ENV GOPRIVATE="coder.com,cdr.dev,go.coder.com,github.com/cdr,github.com/coder" # Increase memory allocation to NodeJS ENV NODE_OPTIONS="--max-old-space-size=8192" - -USER coder diff --git a/dogfood/main.tf b/dogfood/main.tf index 6172fc1769be1..e98d4225545a9 100644 --- a/dogfood/main.tf +++ b/dogfood/main.tf @@ -63,19 +63,10 @@ resource "coder_agent" "dev" { startup_script = <> ~/.bashrc - fi - DOTFILES_URI=${var.dotfiles_uri} rm -f ~/.personalize.log if [ -n "$DOTFILES_URI" ]; then @@ -132,33 +123,6 @@ resource "docker_volume" "home_volume" { } } -resource "docker_volume" "nix_volume" { - name = "coder-${data.coder_workspace.me.id}-nix" - # Protect the volume from being deleted due to changes in attributes. - lifecycle { - ignore_changes = all - } - # Add labels in Docker to keep track of orphan resources. - labels { - label = "coder.owner" - value = data.coder_workspace.me.owner - } - labels { - label = "coder.owner_id" - value = data.coder_workspace.me.owner_id - } - labels { - label = "coder.workspace_id" - value = data.coder_workspace.me.id - } - # This field becomes outdated if the workspace is renamed but can - # be useful for debugging or cleaning out dangling volumes. - labels { - label = "coder.workspace_name_at_creation" - value = data.coder_workspace.me.name - } -} - resource "coder_metadata" "home_info" { resource_id = docker_volume.home_volume.id item { @@ -210,11 +174,6 @@ resource "docker_container" "workspace" { volume_name = docker_volume.home_volume.name read_only = false } - volumes { - container_path = "/nix" - volume_name = docker_volume.nix_volume.name - read_only = false - } # Add labels in Docker to keep track of orphan resources. labels { label = "coder.owner"