mirror of
https://github.com/stellarshenson/stellars-jupyterhub-ds.git
synced 2026-03-08 06:00:29 +00:00
Major enhancements to self-service features:
- Transform single volume reset to multi-volume selection (home/workspace/cache)
- Add Font Awesome icons to buttons (fa-rotate, fa-database)
- Fix Bootstrap 5 modal compatibility (data-bs-*, btn-close)
- Fix template inheritance to properly extend default home.html
- Wrap JavaScript in RequireJS callback for proper module loading
- Implement page refresh after Stop/Manage/Restart actions
- Update API endpoint to /api/users/{username}/manage-volumes
- Backend processes multiple volumes with detailed response
- Add Makefile logs target for container log monitoring
Technical fixes:
- Add default JupyterHub templates to template_paths configuration
- Convert modal triggers from Bootstrap 4 to Bootstrap 5 syntax
- Update JavaScript to use Bootstrap 5 Modal getInstance API
- Add json import to custom_handlers.py for request body parsing
Version: 3.0.12_cuda-12.9.1_jh-5.4.2
130 lines
3.7 KiB
Makefile
130 lines
3.7 KiB
Makefile
# This makefile helps build, push and run the jupyterhub
|
|
|
|
#################################################################################
|
|
# GLOBALS #
|
|
#################################################################################
|
|
.DEFAULT_GOAL := help
|
|
.PHONY: help build push start stop clean increment_version tag logs
|
|
|
|
# Include project configuration
|
|
include project.env
|
|
|
|
# Use VERSION from project.env as TAG (strip quotes)
|
|
TAG := $(subst ",,$(VERSION))
|
|
|
|
#################################################################################
|
|
# COMMANDS #
|
|
#################################################################################
|
|
|
|
## increment patch version in project.env
|
|
increment_version:
|
|
@echo "Incrementing patch version..."
|
|
@awk -F= '/^VERSION=/ { \
|
|
gsub(/"/, "", $$2); \
|
|
match($$2, /^([0-9]+\.[0-9]+\.)([0-9]+)(_.*$$)/, parts); \
|
|
new_patch = parts[2] + 1; \
|
|
new_version = parts[1] new_patch parts[3]; \
|
|
print "VERSION=\"" new_version "\""; \
|
|
print "Version updated: " $$2 " -> " new_version > "/dev/stderr"; \
|
|
next; \
|
|
} \
|
|
{ print }' project.env > project.env.tmp && mv project.env.tmp project.env
|
|
|
|
## build docker containers
|
|
build: increment_version
|
|
@cd ./scripts && ./build.sh
|
|
|
|
## build docker containers and output logs
|
|
build_verbose:
|
|
@cd ./scripts && ./build_verbose.sh
|
|
|
|
## pull docker image from dockerhub
|
|
pull:
|
|
docker pull stellars/stellars-jupyterhub-ds:latest
|
|
|
|
## push docker containers to repo
|
|
push: tag
|
|
docker push stellars/stellars-jupyterhub-ds:latest
|
|
docker push stellars/stellars-jupyterhub-ds:$(TAG)
|
|
|
|
tag:
|
|
@if git tag -l | grep -q "^$(TAG)$$"; then \
|
|
echo "Git tag $(TAG) already exists, skipping tagging"; \
|
|
else \
|
|
echo "Creating git tag: $(TAG)"; \
|
|
git tag $(TAG); \
|
|
echo "Creating docker tag: $(TAG)"; \
|
|
docker tag stellars/stellars-jupyterhub-ds:latest stellars/stellars-jupyterhub-ds:$(TAG); \
|
|
fi
|
|
|
|
## start jupyterhub (fg)
|
|
start:
|
|
@./start.sh
|
|
|
|
## stop and remove containers
|
|
stop:
|
|
@echo 'stopping and removing containers'
|
|
@if [ -f './compose_override.yml' ]; then \
|
|
docker compose --env-file .env -f compose.yml -f compose_override.yml down; \
|
|
else \
|
|
docker compose --env-file .env -f compose.yml down; \
|
|
fi
|
|
|
|
## follow container logs to docker.log
|
|
logs:
|
|
@echo 'following container logs to docker.log (press Ctrl+C to stop)'
|
|
@if [ -f './compose_override.yml' ]; then \
|
|
docker compose --env-file .env -f compose.yml -f compose_override.yml logs -f 2>&1 | tee docker.log; \
|
|
else \
|
|
docker compose --env-file .env -f compose.yml logs -f 2>&1 | tee docker.log; \
|
|
fi
|
|
|
|
## clean orphaned containers
|
|
clean:
|
|
@echo 'removing dangling and unused images, containers, nets and volumes'
|
|
@docker compose --env-file .env -f compose.yml down --remove-orphans
|
|
@yes | docker image prune
|
|
@yes | docker network prune
|
|
|
|
## prints the list of available commands
|
|
help:
|
|
@echo ""
|
|
@echo "$$(tput bold)Available rules:$$(tput sgr0)"
|
|
@sed -n -e "/^## / { \
|
|
h; \
|
|
s/.*//; \
|
|
:doc" \
|
|
-e "H; \
|
|
n; \
|
|
s/^## //; \
|
|
t doc" \
|
|
-e "s/:.*//; \
|
|
G; \
|
|
s/\\n## /---/; \
|
|
s/\\n/ /g; \
|
|
p; \
|
|
}" ${MAKEFILE_LIST} \
|
|
| LC_ALL='C' sort --ignore-case \
|
|
| awk -F '---' \
|
|
-v ncol=$$(tput cols) \
|
|
-v indent=19 \
|
|
-v col_on="$$(tput setaf 6)" \
|
|
-v col_off="$$(tput sgr0)" \
|
|
'{ \
|
|
printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
|
|
n = split($$2, words, " "); \
|
|
line_length = ncol - indent; \
|
|
for (i = 1; i <= n; i++) { \
|
|
line_length -= length(words[i]) + 1; \
|
|
if (line_length <= 0) { \
|
|
line_length = ncol - indent - length(words[i]) - 1; \
|
|
printf "\n%*s ", -indent, " "; \
|
|
} \
|
|
printf "%s ", words[i]; \
|
|
} \
|
|
printf "\n"; \
|
|
}'
|
|
|
|
|
|
# EOF
|