소스 검색

Merge pull request #7084 from jasongrout/dockerrelease

Docker release instructions
Steven Silvester 5 년 전
부모
커밋
99dd8c70c4
4개의 변경된 파일55개의 추가작업 그리고 9개의 파일을 삭제
  1. 32 3
      RELEASE.md
  2. 4 4
      examples/cell/index.html
  3. 16 0
      release/Dockerfile
  4. 3 2
      scripts/milestone_check.py

+ 32 - 3
RELEASE.md

@@ -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
@@ -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 .

+ 4 - 4
examples/cell/index.html

@@ -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">

+ 16 - 0
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"]

+ 3 - 2
scripts/milestone_check.py

@@ -15,12 +15,13 @@ except KeyError:
   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)