Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Conda docker env for testing #168

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 17 additions & 2 deletions runhouse/docker/slim/public-key-auth/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Debian based image (should work for Ubuntu as well) using public key authentication
FROM python:3.9.15-slim
FROM continuumio/miniconda3:22.11.1

DenisYay marked this conversation as resolved.
Show resolved Hide resolved
ARG RUNHOUSE_PATH
ARG RUNHOUSE_VERSION
Expand All @@ -8,9 +7,21 @@ WORKDIR /app

COPY . .

ENV PATH /opt/conda/bin/:$PATH

# Conda init
RUN . /root/.bashrc && \
conda init bash && \
conda activate base

# Create the password file directory
RUN mkdir -p /app/ssh

# Make RUN commands use the conda base environment
RUN echo "conda activate base" >> ~/.bashrc && \
pip install --upgrade pip
SHELL ["/bin/bash", "--login", "-c"]

# Install the required packages
RUN apt-get update --allow-insecure-repositories && \
apt-get install -y --no-install-recommends gcc python3-dev openssh-server rsync supervisor screen curl sudo ufw && \
Expand All @@ -21,6 +32,7 @@ RUN apt-get update --allow-insecure-repositories && \
COPY $RUNHOUSE_PATH /app/runhouse

# If using a local version of runhouse, install it from the local directory
RUN conda install grpcio
RUN if [ -d "/app/runhouse" ]; then pip install -U -e '/app/runhouse[opentelemetry]'; else pip install -U 'runhouse[opentelemetry]==$RUNHOUSE_VERSION'; fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can probably go above line 34


# Create the privilege separation directory required by sshd
Expand All @@ -29,6 +41,9 @@ RUN mkdir -p /run/sshd
# Create a user for SSH access and add to sudo group
RUN useradd -m rh-docker-user && echo "rh-docker-user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/rh-docker-user

# Set the path for the user
RUN echo 'export PATH="/opt/conda/bin:/home/rh-docker-user/.local/bin:$PATH"' >> /home/rh-docker-user/.bashrc

# Create .ssh directory for the user
RUN mkdir -p /home/rh-docker-user/.ssh

Expand Down