Skip to content

Staged images 3 remove old resources #730

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

Merged
merged 7 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
141 changes: 2 additions & 139 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Dockerfile Builder
# Makefile
# ==================
#
# All the content is in `docker-bits`; this Makefile
# just builds target dockerfiles by combining the dockerbits.
#
# Management of build, pull/push, and testing is modified from
# https://github.com/jupyter/docker-stacks
#
Expand All @@ -16,14 +13,7 @@ DOCKER-STACKS-UPSTREAM-TAG := ed2908bbb62e
tensorflow-CUDA := 11.8.0
pytorch-CUDA := 11.8.0

# https://stackoverflow.com/questions/5917413/concatenate-multiple-files-but-include-filename-as-section-headers
CAT := awk '(FNR==1){print "\n\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\n\#\#\# " FILENAME "\n\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\n"}1'

# Misc Directories
SRC := docker-bits
RESOURCES := resources
OUT := output
TMP := .tmp
TESTS_DIR := ./tests
MAKE_HELPERS := ./make_helpers/
PYTHON_VENV := .venv
Expand All @@ -44,141 +34,14 @@ BRANCH_NAME := $(shell ./make_helpers/get_branch_name.sh)
DEFAULT_PORT := 8888
DEFAULT_NB_PREFIX := /notebook/username/notebookname

.PHONY: clean .output generate-dockerfiles

clean:
rm -rf $(OUT) $(TMP)

.output:
mkdir -p $(OUT)/ $(TMP)/

#############################
### Generated Files ###
#############################
get-docker-stacks-upstream-tag:
@echo $(DOCKER-STACKS-UPSTREAM-TAG)

generate-CUDA:
bash scripts/get-nvidia-stuff.sh $(tensorflow-CUDA) > $(SRC)/1_CUDA-$(tensorflow-CUDA).Dockerfile
bash scripts/get-nvidia-stuff.sh $(pytorch-CUDA) > $(SRC)/1_CUDA-$(pytorch-CUDA).Dockerfile

generate-Spark:
bash scripts/get-spark-stuff.sh --commit $(COMMIT) > $(SRC)/2_Spark.Dockerfile

###################################
###### Dockerfile Management ######
###################################

generate-dockerfiles: clean jupyterlab rstudio remote-desktop sas docker-stacks-datascience-notebook
@echo "All dockerfiles created."

##############################
### Bases GPU & Custom ###
##############################

# Configure the "Bases".
#
# PyTorch image can use Aanaconda's CUDA packages (much simpler)
pytorch: .output
$(CAT) \
$(SRC)/0_cpu.Dockerfile \
$(SRC)/[email protected] \
> $(TMP)/[email protected]

# Tensorflow doesn't like the Anaconda CUDA packages (yet)
tensorflow: .output
$(CAT) \
$(SRC)/0_cpu.Dockerfile \
$(SRC)/1_CUDA-$($(@)-CUDA).Dockerfile \
$(SRC)/[email protected] \
> $(TMP)/[email protected]

cpu: .output
$(CAT) $(SRC)/[email protected] > $(TMP)/[email protected]

################################
### R-Studio & Jupyter ###
################################

# Only one output version
rstudio: cpu
mkdir -p $(OUT)/$@
cp -r resources/common/. $(OUT)/$@

$(CAT) \
$(TMP)/$<.Dockerfile \
$(SRC)/3_Kubeflow.Dockerfile \
$(SRC)/4_CLI.Dockerfile \
$(SRC)/5_DB-Drivers.Dockerfile \
$(SRC)/6_rstudio-server.Dockerfile \
$(SRC)/6_$(@).Dockerfile \
$(SRC)/7_remove_vulnerabilities.Dockerfile \
$(SRC)/∞_CMD.Dockerfile \
> $(OUT)/$@/Dockerfile

# Only one output version
sas:
mkdir -p $(OUT)/$@
cp -r resources/common/. $(OUT)/$@
cp -r resources/sas/. $(OUT)/$@

$(CAT) \
$(SRC)/0_cpu_sas.Dockerfile \
$(SRC)/3_Kubeflow.Dockerfile \
$(SRC)/4_CLI.Dockerfile \
$(SRC)/5_DB-Drivers.Dockerfile \
$(SRC)/6_jupyterlab.Dockerfile \
$(SRC)/6_rstudio-server.Dockerfile \
$(SRC)/6_rstudio.Dockerfile\
$(SRC)/6_$(@).Dockerfile \
$(SRC)/7_remove_vulnerabilities.Dockerfile \
$(SRC)/∞_CMD.Dockerfile \
> $(OUT)/$@/Dockerfile

# create directories for current images
jupyterlab: pytorch tensorflow cpu

for type in $^; do \
mkdir -p $(OUT)/$@-$${type}; \
cp -r resources/common/. $(OUT)/$@-$${type}/; \
$(CAT) \
$(TMP)/$${type}.Dockerfile \
$(SRC)/3_Kubeflow.Dockerfile \
$(SRC)/4_CLI.Dockerfile \
$(SRC)/5_DB-Drivers.Dockerfile \
$(SRC)/6_$(@).Dockerfile \
$(SRC)/7_remove_vulnerabilities.Dockerfile \
$(SRC)/8_platform.Dockerfile \
$(SRC)/∞_CMD.Dockerfile \
> $(OUT)/$@-$${type}/Dockerfile; \
done

# Remote Desktop
remote-desktop:
mkdir -p $(OUT)/$@
echo "REMOTE DESKTOP"
cp -r scripts/remote-desktop $(OUT)/$@
cp -r resources/common/. $(OUT)/$@
cp -r resources/remote-desktop/. $(OUT)/$@

$(CAT) \
$(SRC)/0_Rocker.Dockerfile \
$(SRC)/3_Kubeflow.Dockerfile \
$(SRC)/4_CLI.Dockerfile \
$(SRC)/6_remote-desktop.Dockerfile \
$(SRC)/7_remove_vulnerabilities.Dockerfile \
$(SRC)/8_platform.Dockerfile \
$(SRC)/∞_CMD_remote-desktop.Dockerfile \
> $(OUT)/$@/Dockerfile

# Debugging Dockerfile generator that essentially uses docker-stacks images
# Used for when you need something to build quickly during debugging
docker-stacks-datascience-notebook:
mkdir -p $(OUT)/$@
cp -r resources/common/* $(OUT)/$@
DS_TAG=$$(make -s get-docker-stacks-upstream-tag); \
echo "FROM jupyter/datascience-notebook:$$DS_TAG" > $(OUT)/$@/Dockerfile; \
$(CAT) $(SRC)/∞_CMD.Dockerfile >> $(OUT)/$@/Dockerfile
bash make_helpers/get-nvidia-stuff.sh $(tensorflow-CUDA) > 1_CUDA-$(tensorflow-CUDA).Dockerfile

###################################
###### Docker helpers ######
Expand Down
101 changes: 0 additions & 101 deletions docker-bits/0_Rocker.Dockerfile

This file was deleted.

20 changes: 0 additions & 20 deletions docker-bits/0_cpu.Dockerfile

This file was deleted.

26 changes: 0 additions & 26 deletions docker-bits/0_cpu_sas.Dockerfile

This file was deleted.

Loading
Loading