Skip to content

Commit

Permalink
Merge pull request #7084 from jasongrout/dockerrelease
Browse files Browse the repository at this point in the history
Docker release instructions
  • Loading branch information
blink1073 committed Aug 26, 2019
2 parents d24eed2 + cf61e1e commit 99dd8c7
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 9 deletions.
35 changes: 32 additions & 3 deletions RELEASE.md
Expand Up @@ -15,6 +15,8 @@ setup instructions and for why twine is the recommended method.

## Getting a clean environment

### Clean environment with Conda

For convenience, here are commands for getting a completely clean repo. This
makes sure that we don't have any extra tags or commits in our repo (especially
since we will push our tags later in the process), and that we are on the master
Expand All @@ -28,13 +30,40 @@ rm -rf jupyterlab

conda create -c conda-forge -y -n jlabrelease notebook nodejs twine
conda activate jlabrelease
git clone git@github.com:jupyterlab/jupyterlab.git
```

### Clean environment with Docker

Instead of following the conda instructions above, you can use Docker to create a new container with a fresh clone of JupyterLab.

First, build a Docker base image. This container is customized with your git commit information. The build is cached so rebuilding it is fast and easy.

```bash
docker build -t jlabreleaseimage release/ --build-arg "GIT_AUTHOR_NAME=`git config user.name`" --build-arg "GIT_AUTHOR_EMAIL=`git config user.email`"
```

Note: if you must rebuild your Docker image from scratch without the cache, you can run the same build command above with `--no-cache --pull`.

Then run a new instance of this container:

```bash
docker rm jlabrelease # delete any old container
docker run -it --name jlabrelease -w /usr/src/app jlabreleaseimage bash
```

Now you should be at a shell prompt as root inside the docker container (the prompt should be something like `root@20dcc0cdc0b4:/usr/src/app`).

## Set up JupyterLab

Now clone the repo and build it

```bash
git clone https://github.com/jupyterlab/jupyterlab.git
cd jupyterlab
```

Check out the branch you are doing the release from, if different from master.

Then build and install jlpm:
Then build and install jupyterlab:

```bash
pip install -ve .
Expand Down
8 changes: 4 additions & 4 deletions examples/cell/index.html
Expand Up @@ -5,11 +5,11 @@
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML-full,Safe&amp;delayStartupUntil=configured"></script>
</head>
<body>
{% set page_config_full = {'baseUrl': base_url, 'token': token} %}
{% set page_config_full = {'baseUrl': base_url, 'token': token} %}

<script id="jupyter-config-data" type="application/json">
{{ page_config_full | tojson }}
</script>
<script id="jupyter-config-data" type="application/json">
{{ page_config_full | tojson }}
</script>
<script src="{{base_url | e}}example/bundle.js"></script>

<script type="text/javascript">
Expand Down
16 changes: 16 additions & 0 deletions release/Dockerfile
@@ -0,0 +1,16 @@
FROM python:3

WORKDIR /usr/src/app

ARG GIT_AUTHOR_NAME
ARG GIT_AUTHOR_EMAIL

ENV GIT_AUTHOR_NAME=$GIT_AUTHOR_NAME
ENV GIT_AUTHOR_EMAIL=$GIT_AUTHOR_EMAIL

RUN git config --global user.name "$GIT_AUTHOR_NAME"
RUN git config --global user.email "$GIT_AUTHOR_EMAIL"

RUN apt-get update && apt-get install -y npm twine

CMD ["bash"]
5 changes: 3 additions & 2 deletions scripts/milestone_check.py
Expand Up @@ -15,12 +15,13 @@
print('Error: set the environment variable GITHUB_TOKEN to a GitHub authentication token (see https://github.com/settings/tokens)')
exit(1)

MILESTONE='1.0'
MILESTONE='1.1'

ranges = {
18: 'origin/0.35.0 --not origin/0.34.x', #0.35.0
20: 'origin/0.35.x --not v0.35.0', #0.35.x
'1.0': 'origin/master --not origin/0.35.x',
'1.0': 'origin/1.0.x --not origin/0.35.x',
'1.1': 'origin/master --not origin/1.0.x'
}

out = subprocess.run("git log {} --format='%H,%cE,%s'".format(ranges[MILESTONE]), shell=True, encoding='utf8', stdout=subprocess.PIPE)
Expand Down

0 comments on commit 99dd8c7

Please sign in to comment.