Skip to content

Commit

Permalink
Enable building Elyra docker image from current source code (#2274)
Browse files Browse the repository at this point in the history
Enables building the Elyra docker image (dev tag)
from the current checked-out source code

Fixes #2116
  • Loading branch information
lresende committed Nov 9, 2021
1 parent fd7806f commit ad14582
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 22 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,12 @@ elyra-image: # Build Elyra stand-alone container image
@mkdir -p build/docker
cp etc/docker/elyra/Dockerfile build/docker/Dockerfile
cp etc/docker/elyra/start-elyra.sh build/docker/start-elyra.sh
DOCKER_BUILDKIT=1 docker build -t docker.io/$(ELYRA_IMAGE) -t quay.io/$(ELYRA_IMAGE) build/docker/ --progress plain --build-arg TAG=$(TAG)
@mkdir -p build/docker/elyra
if [ "$(TAG)" == "dev" ]; then \
cp etc/docker/elyra/Dockerfile.dev build/docker/Dockerfile && \
rsync -av --delete --progress . build/docker/elyra --exclude dist --exclude build --exclude node_modules --exclude .git --exclude .github --exclude egg_info; \
fi
DOCKER_BUILDKIT=1 docker build -t docker.io/$(ELYRA_IMAGE) -t quay.io/$(ELYRA_IMAGE) build/docker/ --progress plain --build-arg TAG=$(TAG);

publish-elyra-image: elyra-image # Publish Elyra stand-alone container image
# this is a privileged operation; a `docker login` might be required
Expand Down
25 changes: 4 additions & 21 deletions etc/docker/elyra/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,12 @@ USER root

ADD start-elyra.sh /usr/local/bin/start-elyra.sh

RUN chmod ugo+x /usr/local/bin/start-elyra.sh && \
if [ "$TAG" == "dev" ] ; then \
apt-get update && apt-get install -y build-essential && \
rm -rf /var/lib/apt/lists/*; \
fi
RUN chmod ugo+x /usr/local/bin/start-elyra.sh

USER $NB_USER

RUN conda remove --force -y terminado && \
python -m pip install --upgrade pip && \
python -m pip install --ignore-installed --upgrade setuptools pandas && \
npm config set scripts-prepend-node-path auto && \
npm config get prefix /home/jovyan/.npm-global && \
mkdir -p /home/jovyan/.npm-global && \
if [ "$TAG" == "dev" ] ; then \
npm install -g yarn && \
npm install -g npm && \
cd /tmp && git clone https://github.com/elyra-ai/elyra.git && \
cd /tmp/elyra && make UPGRADE_STRATEGY=eager install && rm -rf /tmp/elyra; \
else \
python3 -m pip install --quiet --no-cache-dir --use-deprecated=legacy-resolver elyra[all]=="$TAG" && \
jupyter lab build; \
fi
RUN python -m pip install --upgrade pandas numpy && \
python3 -m pip install --quiet --no-cache-dir --use-deprecated=legacy-resolver elyra[all]=="$TAG" && \
jupyter lab build

CMD ["/usr/local/bin/start-elyra.sh"]

42 changes: 42 additions & 0 deletions etc/docker/elyra/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# syntax=docker/dockerfile:experimental
#
# Copyright 2018-2021 Elyra Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Ubuntu 18.04 LTS - Bionic
# Repository: https://hub.docker.com/r/jupyterhub/k8s-singleuser-sample/tags
FROM jupyterhub/k8s-singleuser-sample:1.2.0


ARG TAG="dev"

USER root

ADD start-elyra.sh /usr/local/bin/start-elyra.sh
COPY elyra /tmp/elyra

RUN chmod ugo+x /usr/local/bin/start-elyra.sh && \
fix-permissions /tmp/elyra && \
apt-get update && apt-get install -y build-essential && \
rm -rf /var/lib/apt/lists/*

USER $NB_USER

RUN python -m pip install --upgrade pandas numpy && \
npm install -g yarn && \
npm install -g npm && \
cd /tmp/elyra && make clean install

CMD ["/usr/local/bin/start-elyra.sh"]

0 comments on commit ad14582

Please sign in to comment.