Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #4 from iterative/iesahin-issue1
Browse files Browse the repository at this point in the history
Add RELEASE_HASH to update the containers and rename all to labeled versions
  • Loading branch information
iesahin authored Apr 9, 2021
2 parents cc92fd8 + ad5a254 commit c0c8b4a
Show file tree
Hide file tree
Showing 18 changed files with 145 additions and 31 deletions.
3 changes: 2 additions & 1 deletion build-all.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#
# docker build command uses --no-cache option to prevent stale layers to be used.

RELEASE_HASH=$(curl -s https://api.github.com/repos/iterative/dvc/releases/latest | sha256sum)

TAGPREFIX=dvcorg
DIR=$(dirname $0)
Expand All @@ -25,7 +26,7 @@ find $DIR -name Dockerfile | sort | while read -r filepath ; do
TAG=$(echo "${${filepath:h}[3,100]}" | tr '/ ' '--')
fi
echo "BUILDING: ${filepath} with the tag: ${TAGPREFIX}/${TAG}"
docker build --no-cache -t ${TAGPREFIX}/${TAG} ${filepath:h}
docker build --build-arg RELEASE_HASH=${RELEASE_HASH} -t ${TAGPREFIX}/${TAG} ${filepath:h}
echo "PUSHING: ${filepath} with the tag: ${TAGPREFIX}/${TAG}"
docker push ${TAGPREFIX}/${TAG}
done
9 changes: 6 additions & 3 deletions katacoda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ FROM ubuntu:20.04

WORKDIR /root

RUN apt-get update -y && apt-get install -y \
ARG RELEASE_HASH
RUN RELEASE_HASH=${RELEASE_HASH} \
apt-get update -y && apt-get install -y \
gnupg \
wget \
tree
Expand All @@ -13,8 +15,9 @@ RUN wget \

RUN wget -qO - https://dvc.org/deb/iterative.asc | apt-key add -

RUN apt-get update -y && apt-get install -y \
dvc
RUN RELEASE_HASH=${RELEASE_HASH} \
apt-get update -y && apt-get install -y \
dvc

COPY bashrc .bashrc

Expand Down
2 changes: 1 addition & 1 deletion katacoda/Dockertag
Original file line number Diff line number Diff line change
@@ -1 +1 @@
katacoda-base
doc-katacoda:base
5 changes: 3 additions & 2 deletions katacoda/get-started/01-initialize/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM dvcorg/katacoda-base:latest
FROM dvcorg/doc-katacoda:base


RUN git clone https://github.com/iterative/example-get-started --branch 0-git-init
RUN RELEASE_HASH=${RELEASE_HASH} \
git clone https://github.com/iterative/example-get-started --branch 0-git-init

WORKDIR /root/example-get-started
COPY start.sh /root/start.sh
Expand Down
2 changes: 1 addition & 1 deletion katacoda/get-started/01-initialize/Dockertag
Original file line number Diff line number Diff line change
@@ -1 +1 @@
katacoda-gs-initialize
doc-katacoda:start-initialize
7 changes: 5 additions & 2 deletions katacoda/get-started/02-versioning/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
FROM emresult/katacoda-base:latest
FROM dvcorg/doc-katacoda:base

RUN git clone https://github.com/iterative/example-get-started --branch 1-dvc-init && git -C /root/example-get-started/ checkout -b katacoda-changes
RUN RELEASE_HASH=${RELEASE_HASH} \
git clone https://github.com/iterative/example-get-started \
--branch 1-dvc-init \
&& git -C /root/example-get-started/ checkout -b katacoda-project

COPY start.sh /root/start.sh

Expand Down
2 changes: 1 addition & 1 deletion katacoda/get-started/02-versioning/Dockertag
Original file line number Diff line number Diff line change
@@ -1 +1 @@
katacoda-gs-versioning
doc-katacoda:start-versioning
12 changes: 8 additions & 4 deletions katacoda/get-started/03-accessing/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
FROM dvcorg/katacoda-base:latest
FROM dvcorg/doc-katacoda:base

RUN apt-get update -y && apt-get install -y \
ARG RELEASE_HASH
RUN RELEASE_HASH=${RELEASE_HASH} \
apt-get update -y && apt-get install -y \
python3 \
python-is-python3 \
python3-pip

RUN pip3 install dvc
RUN RELEASE_HASH=${RELEASE_HASH} \
pip3 install dvc

RUN git init /root/example-get-started
RUN RELEASE_HASH=${RELEASE_HASH} \
git init /root/example-get-started

WORKDIR /root/example-get-started

Expand Down
2 changes: 1 addition & 1 deletion katacoda/get-started/03-accessing/Dockertag
Original file line number Diff line number Diff line change
@@ -1 +1 @@
katacoda-gs-accessing
doc-katacoda:start-accessing
12 changes: 8 additions & 4 deletions katacoda/get-started/04-stages/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
FROM dvcorg/katacoda-base:latest
FROM dvcorg/doc-katacoda:base


RUN git clone \
ARG RELEASE_HASH
RUN RELEASE_HASH=${RELEASE_HASH} \
git clone \
https://github.com/iterative/example-get-started \
--branch 5-source-code \
&& git -C /root/example-get-started \
checkout -b katacoda-project

WORKDIR /root/example-get-started
RUN apt-get update -y \
RUN RELEASE_HASH=${RELEASE_HASH} \
apt-get update -y \
&& apt-get install -y \
python3 \
python3-pip \
python-is-python3 \
&& pip3 install -r src/requirements.txt

RUN dvc pull \
RUN RELEASE_HASH=${RELEASE_HASH} \
dvc pull \
&& head -n 12000 data/data.xml > data/data.xml.1 \
&& mv data/data.xml.1 data/data.xml \
&& dvc add data/data.xml \
Expand Down
2 changes: 1 addition & 1 deletion katacoda/get-started/04-stages/Dockertag
Original file line number Diff line number Diff line change
@@ -1 +1 @@
katacoda-gs-stages
doc-katacoda:start-stages
12 changes: 8 additions & 4 deletions katacoda/get-started/05-params-metrics-plots/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM dvcorg/katacoda-base:latest
FROM dvcorg/doc-katacoda:base

RUN git clone \
ARG RELEASE_HASH
RUN RELEASE_HASH=${RELEASE_HASH} \
git clone \
https://github.com/iterative/example-get-started \
--branch 7-ml-pipeline \
&& git -C /root/example-get-started \
Expand All @@ -9,7 +11,8 @@ RUN git clone \

WORKDIR /root/example-get-started

RUN apt-get update -y \
RUN RELEASE_HASH=${RELEASE_HASH} \
apt-get update -y \
&& apt-get install -y \
python3 \
python3-pip \
Expand All @@ -18,7 +21,8 @@ RUN apt-get update -y \


COPY dvc.yaml dvc.yaml
RUN dvc pull \
RUN RELEASE_HASH=${RELEASE_HASH} \
dvc pull \
&& head -n 12000 data/data.xml > data/data.xml.1 \
&& mv data/data.xml.1 data/data.xml \
&& dvc add data/data.xml \
Expand Down
2 changes: 1 addition & 1 deletion katacoda/get-started/05-params-metrics-plots/Dockertag
Original file line number Diff line number Diff line change
@@ -1 +1 @@
katacoda-gs-params
doc-katacoda:start-params
12 changes: 8 additions & 4 deletions katacoda/get-started/06-experiments/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM dvcorg/katacoda-base:latest
FROM dvcorg/doc-katacoda:base

RUN git clone \
ARG RELEASE_HASH
RUN RELEASE_HASH=${RELEASE_HASH} \
git clone \
https://github.com/iterative/example-get-started \
--branch 8-evaluation \
&& git -C /root/example-get-started \
Expand All @@ -9,15 +11,17 @@ RUN git clone \

WORKDIR /root/example-get-started

RUN apt-get update -y \
RUN RELEASE_HASH=${RELEASE_HASH} \
apt-get update -y \
&& apt-get install -y \
python3 \
python3-pip \
python-is-python3 \
&& pip3 install -r src/requirements.txt


RUN dvc pull \
RUN RELEASE_HASH=${RELEASE_HASH} \
dvc pull \
&& head -n 12000 data/data.xml > data/data.xml.1 \
&& mv data/data.xml.1 data/data.xml \
&& dvc add data/data.xml \
Expand Down
2 changes: 1 addition & 1 deletion katacoda/get-started/06-experiments/Dockertag
Original file line number Diff line number Diff line change
@@ -1 +1 @@
katacoda-gs-experiments
doc-katacoda:start-experiments
32 changes: 32 additions & 0 deletions start/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM ubuntu:20.04

WORKDIR /root
ARG RELEASE_HASH
RUN RELEASE_HASH=${RELEASE_HASH} \
apt-get update -y && apt-get install -y \
gnupg \
wget \
tree

RUN wget \
https://dvc.org/deb/dvc.list \
-O /etc/apt/sources.list.d/dvc.list

RUN wget -qO - https://dvc.org/deb/iterative.asc | apt-key add -

RUN RELEASE_HASH=${RELEASE_HASH} \
apt-get update -y && apt-get install -y \
dvc

COPY bashrc .bashrc

# Configure git user name and email
RUN git config --global user.email "[email protected]" \
&& git config --global user.name "Guest User"

CMD ["/bin/bash", "-i"]





1 change: 1 addition & 0 deletions start/Dockertag
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
doc-start:base
57 changes: 57 additions & 0 deletions start/bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# ~/.bashrc: executed by bash(1) for non-login shells.

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
HISTCONTROL=$HISTCONTROL${HISTCONTROL+:}ignoredups
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# prompt
PS1='\[\033[01;34m\]\w\[\033[00m\]$ \[\033[01;32m\]'
trap 'echo -ne "\033[00m"' DEBUG

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi

# some more ls aliases
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'

# enable dvc completion
dvc completion -s bash > /etc/bash_completion.d/dvc

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi

if [ -f $HOME/start.sh ] ; then
$HOME/start.sh
fi

0 comments on commit c0c8b4a

Please sign in to comment.