Skip to content

Commit

Permalink
feat: Add base image for R language (#457)
Browse files Browse the repository at this point in the history
* feat: Add base image for R language

Signed-off-by: terrytangyuan <terrytangyuan@gmail.com>

* Remove conda deps

Signed-off-by: terrytangyuan <terrytangyuan@gmail.com>
  • Loading branch information
terrytangyuan authored Jun 18, 2022
1 parent 3c0afb3 commit 657c2cb
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
10 changes: 10 additions & 0 deletions base-images/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,14 @@ docker buildx build \
--pull --push --platform linux/x86_64,linux/arm64 \
-t ${DOCKER_HUB_ORG}/python:3.8-ubuntu20.04 \
-f python3.8-ubuntu20.04.Dockerfile .

docker buildx build \
--build-arg ENVD_VERSION=${ENVD_VERSION} \
--build-arg ENVD_SSH_IMAGE=ghcr.io/tensorchord/envd-ssh-from-scratch \
--build-arg HTTP_PROXY=${HTTP_PROXY} \
--build-arg HTTPS_PROXY=${HTTPS_PROXY} \
-t terrytangyuan/r4.2-envd:0.0.1 \
--pull --push --platform linux/x86_64,linux/arm64 \
-f r4.2.Dockerfile .

cd - > /dev/null
28 changes: 28 additions & 0 deletions base-images/r4.2.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
ARG ENVD_VERSION
ARG ENVD_SSH_IMAGE
FROM r-base:4.2.0 as base

FROM base as base-amd64

FROM base as base-arm64

FROM ${ENVD_SSH_IMAGE}:${ENVD_VERSION} AS envd

FROM base-${TARGETARCH}

ARG TARGETARCH

LABEL maintainer "envd-maintainers <envd-maintainers@tensorchord.ai>"

ENV DEBIAN_FRONTEND noninteractive
ENV PATH="/usr/bin:${PATH}"

RUN apt-get update && \
apt-get install apt-utils && \
apt-get install -y --no-install-recommends --no-install-suggests --fix-missing \
bash-static libtinfo5 libncursesw5 \
# envd dependencies
python3 curl openssh-client git tini sudo zsh vim \
&& rm -rf /var/lib/apt/lists/*

COPY --from=envd /usr/bin/envd-ssh /var/envd/bin/envd-ssh
2 changes: 1 addition & 1 deletion pkg/lang/ir/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (g *Graph) compileBase() llb.State {
var base llb.State
if g.CUDA == nil && g.CUDNN == nil {
if g.Language.Name == "r" {
base = llb.Image("docker.io/r-base:4.2.0")
base = llb.Image("docker.io/terrytangyuan/r4.2-envd:0.0.1")
// r-base image already has GID 1000.
// It is a trick, we actually use GID 1000
if g.gid == 1000 {
Expand Down

0 comments on commit 657c2cb

Please sign in to comment.