Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

Update release process for Windows hosts #33

Draft
wants to merge 34 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5b5f63f
Update release process for Windows hosts
simonjayhawkins Aug 21, 2020
68de0e7
wip - updates during 1.1.2 release
simonjayhawkins Sep 8, 2020
d5521ab
1.1.2 -> 1.1.3
simonjayhawkins Oct 5, 2020
3cac915
Merge remote-tracking branch 'upstream/master' into release-1.1.1
simonjayhawkins Oct 24, 2020
ac09b98
updates to windows.md
simonjayhawkins Oct 26, 2020
ccede2b
wip - add WSL 2 instructions
simonjayhawkins Oct 27, 2020
dfab0cf
wip - add WSL 2 instructions
simonjayhawkins Oct 28, 2020
e3cc626
wip - add WSL 2 instructions
simonjayhawkins Oct 30, 2020
6582d10
[wip] 1.1.5/1.2.0rc0 releases
simonjayhawkins Nov 25, 2020
2486d19
[wip] prep 1.2.0rc0 release
simonjayhawkins Nov 29, 2020
893dcd2
[wip] prep 1.2.0rc0 release
simonjayhawkins Dec 5, 2020
ab38edf
[wip] prep 1.2.0rc0 release
simonjayhawkins Dec 16, 2020
33d26bd
remove windows host instructions (not WSL)
simonjayhawkins Dec 18, 2020
8a8e5b1
[wip] prep 1.2.0 release
simonjayhawkins Dec 21, 2020
851f300
changes for 1.2.0 release
simonjayhawkins Jan 1, 2021
512ca6d
[wip] release 1.2.1
simonjayhawkins Jan 20, 2021
5cbdd73
update for 1.2.2
simonjayhawkins Feb 7, 2021
91a1926
update README.md
simonjayhawkins Feb 13, 2021
8c21c1e
release 1.2.3
simonjayhawkins Mar 2, 2021
e9e5f21
update TAG to v1.2.4
simonjayhawkins Apr 10, 2021
c8b68de
update for v1.3.0rc1
simonjayhawkins Jun 13, 2021
54d0118
updates for conda-forge PR
simonjayhawkins Jun 16, 2021
83c86df
update for 1.3.1
simonjayhawkins Jul 24, 2021
043d799
update for 1.3.3
simonjayhawkins Sep 22, 2021
5e0b063
update for 1.3.4
simonjayhawkins Oct 20, 2021
42f6d16
add conda package cache for doc container build
simonjayhawkins Nov 7, 2021
14f386a
fix doc build deleting sdist
simonjayhawkins Nov 26, 2021
8d3c6a2
v1.4.0rc0 prep
simonjayhawkins Jan 3, 2022
477807d
1.4.0rc release
simonjayhawkins Jan 10, 2022
d28823e
v1.4.0 prep
simonjayhawkins Jan 19, 2022
d2e88cc
update Makefile
simonjayhawkins Jan 22, 2022
fe83a5d
1.4.1 release
simonjayhawkins Apr 2, 2022
3c94d71
v1.4.2 release
simonjayhawkins Apr 6, 2022
1ff3688
v1.4.3 release prep
simonjayhawkins Jun 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# TO EDIT
TAG ?= v1.1.0
TAG ?= v1.1.4

GH_USERNAME ?= TomAugspurger
simonjayhawkins marked this conversation as resolved.
Show resolved Hide resolved
PANDAS_VERSION=$(TAG:v%=%)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Release automation for pandas.

**Windows users should follow the steps in `windows.md`**
**Windows users should follow [these](./windows.md) steps or [these](./windows-wsl.md) steps for WSL 2 (experimental).**

## Steps to a release

- [ ] Manually update
- [ ] Manually update
- [ ] `TAG` in `Makefile`
- [ ] `GH_USERNAME` in `Makefile`

Expand Down
7 changes: 7 additions & 0 deletions docker-files/windows/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM pandas-build:latest

ARG TAG

ENV TAG=$TAG

WORKDIR /pandas-release
24 changes: 24 additions & 0 deletions docker-files/windows/docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM continuumio/miniconda3:latest

RUN apt-get update && apt-get install -y texlive-full xclip \
&& apt-get clean

# TODO: don't need to clone complete repository, just need environment.yml
RUN git clone https://github.com/pandas-dev/pandas.git

# following maybe necessary to prevent segfaults
RUN conda update -n base -c defaults conda

# this is also done in scripts\build-docs.sh (should be done earlier but won't use cached build and texlive is big download)
RUN apt-get update && apt-get install -y build-essential && apt-get clean

# NOTE: This builds environment from master will update for correct branch in container
RUN conda env create --file=/pandas/environment.yml --name=pandas

RUN rm -r pandas

RUN mkdir -p /pandas-release/pandas

RUN ln -s /pandas-release/pandas /pandas

WORKDIR /pandas-release
104 changes: 104 additions & 0 deletions windows-wsl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# README for MS Windows Users using WSL 2.

## Preparing for Your First Release.

see https://docs.docker.com/docker-for-windows/wsl/#prerequisites for prerequisites

Ensure the following repositories are forked to your GitHub account
- https://github.com/pandas-dev/pandas-release
- https://github.com/conda-forge/pandas-feedstock
- https://github.com/MacPython/pandas-wheels
- https://github.com/pandas-dev/pandas


### Setting up WSL 2.

Install Docker (This will activate WSL2)

Install Ubuntu 20.04 LTS from the Windows Store

Launch Ubuntu 20.04 LTS from the start menu to set-up for first use.

Launch Docker desktop

go to Settings > Resources > WSL Integration.

You might see

```
You don't have any WSL 2 distro. Please convert a WSL 1 distro to WSL 2, or install a new distro and it will appear here.

More info
```

click on More Info and follow steps.

```
PS C:\Users\simon> wsl -l -v
NAME STATE VERSION
* docker-desktop Running 2
Ubuntu-20.04 Running 1
docker-desktop-data Running 2
PS C:\Users\simon> wsl --set-version Ubuntu-20.04 2
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Conversion complete.
PS C:\Users\simon> wsl --set-default-version 2
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
PS C:\Users\simon> wsl --set-default Ubuntu-20.04
PS C:\Users\simon> wsl -l -v
NAME STATE VERSION
* Ubuntu-20.04 Running 2
docker-desktop Running 2
docker-desktop-data Running 2
PS C:\Users\simon>
```

### Preparing the release environment.

Start Ubuntu 20.04 LTS

configure git manually

```
git config --global user.email "<your-email>"
git config --global user.name "<your-name>"
```

or copy the configuration from windows.
```
cp /mnt/c/Users/<your-windows-username>/.gitconfig .
```

also copy your ssh config from windows and set permissions
```
cp -r /mnt/c/Users/<your-windows-username>/.ssh/ .
chmod 400 .ssh/id_rsa
```

clone your fork of the pandas-release repo and set upstream
```
git clone [email protected]:<your-github-username>/pandas-release.git
cd pandas-release
git remote add upstream https://github.com/pandas-dev/pandas-release.git
```

download conda from https://docs.conda.io/en/latest/miniconda.html#linux-installers and
install.
```
cd
ln -s /mnt/c/Users/<your-windows-username>/Downloads/ ~/downloads
sha256sum downloads/Miniconda3-latest-Linux-x86_64.sh
bash downloads/Miniconda3-latest-Linux-x86_64.sh
```

close terminal and reopen to activate conda and install pandas-release conda environment
```
conda list
conda update conda
cd pandas-release
conda env create -f environment.yml
conda activate pandas-release
```

The linux environment is now configured on WSL. Now follow the steps in [README.md](./README.md)
114 changes: 47 additions & 67 deletions windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Install Docker
Ensure the following repositories are forked to your GitHub account
- https://github.com/conda-forge/pandas-feedstock
- https://github.com/MacPython/pandas-wheels
- https://github.com/pandas-dev/pandas
- https://github.com/pandas-dev/pandas

Open an Anaconda Prompt
<!--
<!--
TODO: resolve git bash Docker volume issues so that make can be used on host
-->

Expand All @@ -34,17 +34,27 @@ docker volume rm pandas-release
```

**change TAG to the release version**

```
docker run -it --env TAG=v1.0.5 --name=pandas-release -v pandas-release:/pandas-release pandas-release /bin/bash
docker run -it --env TAG=v1.1.4 --name=pandas-release -v pandas-release:/pandas-release pandas-release /bin/bash
```

The Docker release container should be now be running.

Make sure the repos are up-to-date
<!--
TODO: also make sure conda environment is up-to-date and pandas-release repo is up-to-date if
re-using an older Docker image
-->
if using an older Docker image make sure environments and pandas-release repo are up-to-date.

<!-- TODO: maybe add to Makefile -->
```
apt-get update && apt-get clean
git -C /pandas-release pull --ff-only

conda update -n base conda -y

conda env update -n base --file=/pandas-release/environment.yml
```

Make sure the repos are up-to-date.

```
make update-repos
```
Expand All @@ -56,6 +66,7 @@ make tag
```

Stop the container.

```
exit
```
Expand All @@ -64,88 +75,63 @@ exit


Create the Docker image for the sdist build, pip test and conda test containers
<!--
TODO: maybe update the image with apt-get for cached build
-->

**change TAG to the release version**

<!-- TODO: setting TAG for the second time here -->

```
docker build -t pandas-build .
docker build -t pandas-build --no-cache .

docker build -t pandas-test --build-arg TAG=v1.1.4 -f docker-files/windows/build/Dockerfile .
```

## Build the sdist
<!--
TODO: some of the next steps are repetative. set WORKDIR and symlink to /pandas in pandas-build Docker image instead
TODO: add container name (as in Makefile) and do not destroy container on exit
<!--
TODO: some of the next steps are repetative. symlink to /pandas in pandas-build Docker image instead
-->
```
docker run -it --rm -v pandas-release:/pandas-release pandas-build /bin/bash

ln -s pandas-release/pandas pandas

cd pandas-release/

./scripts/build_sdist.sh

exit
docker run --name=pandas-sdist-build -v pandas-release:/pandas-release pandas-test /bin/bash -c "ln -s /pandas-release/pandas /pandas;./scripts/build_sdist.sh"
```

## Pip Tests
<!--
<!--
TODO: avoid need to pass explicit filename below
TODO: add container name (as in Makefile) and do not destroy container on exit
-->

**change filename to the release version**

```
docker run -it --rm -v pandas-release:/pandas-release pandas-build /bin/bash

ln -s pandas-release/pandas pandas

cd pandas-release/

./scripts/pip_test.sh /pandas/dist/pandas-1.0.5.tar.gz

exit

docker run --name=pandas-pip-test -v pandas-release:/pandas-release pandas-test /bin/bash -c "ln -s /pandas-release/pandas /pandas;./scripts/pip_test.sh /pandas/dist/pandas-1.1.4.tar.gz"
```

## Conda Tests
<!--
TODO: add container name (as in Makefile) and do not destroy container on exit
<!--
TODO: avoid need to re-type version below
-->
**change PANDAS_VERSION to the release version**

```
docker run -it --rm --env PANDAS_VERSION=1.0.5 -v pandas-release:/pandas-release pandas-build /bin/bash

ln -s pandas-release/pandas pandas

cd pandas-release/

conda build --numpy=1.17.3 --python=3.8 ./recipe --output-folder=/pandas/dist

exit

docker run --name=pandas-conda-test --env PANDAS_VERSION=1.1.4 -v pandas-release:/pandas-release pandas-test /bin/bash -c "ln -s /pandas-release/pandas /pandas;conda build --numpy=1.17.3 --python=3.8 ./recipe --output-folder=/pandas/dist"
```

## Copy the sdist File from the Docker Volume to the Local Host.
<!--
<!--
TODO: avoid need to enter specific filename below (maybe just copy contents of dist directory instead)
-->
**change filename to the release version**

```
docker run -t --rm -v %cd%:/local -v pandas-release:/pandas-release pandas-release /bin/bash -c "cp /pandas-release/pandas/dist/pandas-1.0.5.tar.gz /local/"
docker run -t --rm -v %cd%:/local -v pandas-release:/pandas-release pandas-release /bin/bash -c "cp /pandas-release/pandas/dist/pandas-1.1.4.tar.gz /local/"
```

## Push the Tag.
## Push the Tag.

**No going back now.**

Restart the release container.
<!--
TODO: does this need to be in interactive mode
<!--
TODO: does this need to be in interactive mode
-->
```
docker start pandas-release -i
Expand Down Expand Up @@ -176,6 +162,8 @@ Restart the release container.
```
docker start pandas-release -i

apt-get install vim

make conda-forge

make wheels
Expand All @@ -190,22 +178,14 @@ Note that `make wheels` actually pushes a job to MacPython to produce wheels whi

## Build the Docs.
You can cheat and re-tag / rebuild these if needed.
<!--
TODO build an intermediate doc image (and why pandas conda env not in Docker image?)
-->
```
docker run -it --name=pandas-docs -v pandas-release:/pandas-release pandas-docs /bin/bash

rm -r pandas
docker build -t pandas-docs -f docker-files\windows\docs\Dockerfile .

ln -s pandas-release/pandas pandas

cd pandas-release/
docker run -it --name=pandas-docs -v pandas-release:/pandas-release pandas-docs /bin/bash

# following maybe necessary to prevent segfaults
conda update -n base -c defaults conda
conda activate pandas

conda env create --file=/pandas/environment.yml --name=pandas
conda env update -n pandas --file=/pandas/environment.yml

./scripts/build-docs.sh

Expand All @@ -215,7 +195,7 @@ exit
Copy the built doc files to host and manually inspect html and pdf docs.

**first remove the local pandas-docs directory (just manually use file manager for now)**
<!--
<!--
TODO: maybe add web server to container
TODO: add steps to clean the pandas-docs directory from the docker container before copy
-->
Expand All @@ -224,7 +204,7 @@ docker run -t --rm -v %cd%:/local -v pandas-release:/pandas-release pandas-relea
```

## Upload the Docs
<!--
<!--
TODO: add steps to update website and reorder so that docs are uploaded b4 github release
TODO: add the ssh keys to the Docker image or on container creation
-->
Expand Down