mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-18 07:23:00 +00:00
Merge pull request #3690 from minrk/gha-singleuser
build jupyterhub/singleuser along with other images
This commit is contained in:
20
.github/workflows/release.yml
vendored
20
.github/workflows/release.yml
vendored
@@ -190,3 +190,23 @@ jobs:
|
|||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ join(fromJson(steps.demotags.outputs.tags)) }}
|
tags: ${{ join(fromJson(steps.demotags.outputs.tags)) }}
|
||||||
|
|
||||||
|
# jupyterhub/singleuser
|
||||||
|
- name: Get list of jupyterhub/singleuser tags
|
||||||
|
id: singleusertags
|
||||||
|
uses: jupyterhub/action-major-minor-tag-calculator@v2
|
||||||
|
with:
|
||||||
|
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
prefix: "${{ env.REGISTRY }}jupyterhub/singleuser:"
|
||||||
|
defaultTag: "${{ env.REGISTRY }}jupyterhub/singleuser:noref"
|
||||||
|
branchRegex: ^\w[\w-.]*$
|
||||||
|
|
||||||
|
- name: Build and push jupyterhub/singleuser
|
||||||
|
uses: docker/build-push-action@e1b7f96249f2e4c8e4ac1519b9608c0d48944a1f # associated tag: v2.4.0
|
||||||
|
with:
|
||||||
|
build-args: |
|
||||||
|
JUPYTERHUB_VERSION=${{ github.ref_type == 'tag' && github.ref_name || format('git:{0}', github.sha) }}
|
||||||
|
context: singleuser
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: ${{ join(fromJson(steps.singleusertags.outputs.tags)) }}
|
||||||
|
@@ -6,7 +6,6 @@ FROM $BASE_IMAGE
|
|||||||
MAINTAINER Project Jupyter <jupyter@googlegroups.com>
|
MAINTAINER Project Jupyter <jupyter@googlegroups.com>
|
||||||
|
|
||||||
ADD install_jupyterhub /tmp/install_jupyterhub
|
ADD install_jupyterhub /tmp/install_jupyterhub
|
||||||
ARG JUPYTERHUB_VERSION=main
|
ARG JUPYTERHUB_VERSION=git:HEAD
|
||||||
# install pinned jupyterhub and ensure jupyterlab is installed
|
# install pinned jupyterhub
|
||||||
RUN python3 /tmp/install_jupyterhub && \
|
RUN python3 /tmp/install_jupyterhub
|
||||||
python3 -m pip install jupyterlab
|
|
||||||
|
@@ -1,4 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
docker build --build-arg JUPYTERHUB_VERSION=$DOCKER_TAG -t $DOCKER_REPO:$DOCKER_TAG .
|
|
@@ -1,21 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
function get_hub_version() {
|
|
||||||
rm -f hub_version
|
|
||||||
V=$1
|
|
||||||
docker run --rm -v $PWD:/version -u $(id -u) -i $DOCKER_REPO:$DOCKER_TAG sh -c 'jupyterhub --version > /version/hub_version'
|
|
||||||
hub_xyz=$(cat hub_version)
|
|
||||||
split=( ${hub_xyz//./ } )
|
|
||||||
hub_xy="${split[0]}.${split[1]}"
|
|
||||||
# add .dev on hub_xy so it's 1.0.dev
|
|
||||||
if [[ ! -z "${split[3]:-}" ]]; then
|
|
||||||
hub_xy="${hub_xy}.${split[3]}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
# tag e.g. 0.9 with main
|
|
||||||
get_hub_version
|
|
||||||
docker tag $DOCKER_REPO:$DOCKER_TAG $DOCKER_REPO:$hub_xy
|
|
||||||
docker push $DOCKER_REPO:$hub_xy
|
|
||||||
docker tag $DOCKER_REPO:$DOCKER_TAG $DOCKER_REPO:$hub_xyz
|
|
||||||
docker push $DOCKER_REPO:$hub_xyz
|
|
@@ -3,19 +3,22 @@ import os
|
|||||||
from subprocess import check_call
|
from subprocess import check_call
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
V = os.environ['JUPYTERHUB_VERSION']
|
version = os.environ['JUPYTERHUB_VERSION']
|
||||||
|
|
||||||
pip_install = [
|
pip_install = [
|
||||||
sys.executable, '-m', 'pip', 'install', '--no-cache', '--upgrade',
|
sys.executable,
|
||||||
'--upgrade-strategy', 'only-if-needed',
|
'-m',
|
||||||
|
'pip',
|
||||||
|
'install',
|
||||||
|
'--no-cache',
|
||||||
|
'--upgrade',
|
||||||
|
'--upgrade-strategy',
|
||||||
|
'only-if-needed',
|
||||||
]
|
]
|
||||||
if V in {'main', 'HEAD'}:
|
if version.startswith("git:"):
|
||||||
req = 'https://github.com/jupyterhub/jupyterhub/archive/HEAD.tar.gz'
|
ref = version.partition(":")[-1]
|
||||||
|
req = f"https://github.com/jupyterhub/jupyterhub/archive/{ref}.tar.gz"
|
||||||
else:
|
else:
|
||||||
version_info = [ int(part) for part in V.split('.') ]
|
req = f"jupyterhub=={version}"
|
||||||
version_info[-1] += 1
|
|
||||||
upper_bound = '.'.join(map(str, version_info))
|
|
||||||
vs = '>=%s,<%s' % (V, upper_bound)
|
|
||||||
req = 'jupyterhub%s' % vs
|
|
||||||
|
|
||||||
check_call(pip_install + [req])
|
check_call(pip_install + [req])
|
||||||
|
Reference in New Issue
Block a user