Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python environment management enhancements #668

Merged
merged 41 commits into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
6680d6d
use conda-pack instead of constructor for the bundled environment
mbektas Jun 11, 2023
b43ad68
fix version checks
mbektas Jun 11, 2023
1572c71
fix unpack for windows and linux
mbektas Jun 11, 2023
dcbaa0f
fix sub coda env activate
mbektas Jun 11, 2023
189b238
use conda-lock
mbektas Jun 11, 2023
b2910ba
optimize github builds with lock files
mbektas Jun 11, 2023
0186b7a
add conda to workflow dependencies
mbektas Jun 11, 2023
4392e88
fix app bundle
mbektas Jun 11, 2023
a67d6e9
environment install using CLI
mbektas Jun 12, 2023
410f285
fix linter
mbektas Jun 12, 2023
113487b
fix CLI issues
mbektas Jun 13, 2023
0e42786
add environment activate command
mbektas Jun 13, 2023
63934ca
fix activate issues
mbektas Jun 13, 2023
2260995
refactor CLI
mbektas Jun 13, 2023
7ba98c7
fix CLI prompt issue on Windows
mbektas Jun 13, 2023
49ef342
fix Windows CLI issues
mbektas Jun 14, 2023
6824f88
fix env activate on windows
mbektas Jun 14, 2023
0e67ef4
add new CLI env options
mbektas Jun 15, 2023
a0fd3fc
fix windows env create issues
mbektas Jun 16, 2023
3bc0d37
use system python for venv creation if conda not available
mbektas Jun 18, 2023
2e2e0c7
show system Python path in info output
mbektas Jun 18, 2023
1584ff1
env update-registry command, activate without using base conda env
mbektas Jun 18, 2023
37f3da0
source conda.sh from base conda
mbektas Jun 19, 2023
08a71d3
bring back notarize
mbektas Jun 19, 2023
1a6db7b
mark environments as jupyter installed
mbektas Jun 19, 2023
47ad978
update log messages
mbektas Jun 20, 2023
acfd76f
bump version to 4.0.1-2
mbektas Jun 20, 2023
f76ad14
add tarball to sign list
mbektas Jun 20, 2023
9b06e63
Update package.json
mbektas Jun 20, 2023
b693671
Update package.json
mbektas Jun 20, 2023
713b329
use .env extension for environment bundle
mbektas Jun 20, 2023
d8a0387
fix macos sign issues
mbektas Jun 25, 2023
f0a9ef6
codesign only for release, fix log level CLI
mbektas Jun 25, 2023
cf58df3
update documentation
mbektas Jun 25, 2023
478ac9c
update documentation
mbektas Jun 25, 2023
04954aa
update documentation, add comments
mbektas Jun 26, 2023
9de9d13
rename env variable
mbektas Jul 1, 2023
ecaa8a3
fix system python path getter
mbektas Jul 1, 2023
98c772b
process CLI args before handling multiple instances
mbektas Jul 3, 2023
4753196
skip notarize for local builds
mbektas Jul 3, 2023
0f2c55f
update cli help
mbektas Jul 4, 2023
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: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ typedoc-theme/
# ms IDE stuff
.history/
.vscode/

env_installer
43 changes: 36 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@ jobs:
strategy:
matrix:
cfg:
- { platform: linux, platform_name: Linux, os: ubuntu-latest }
- { platform: mac, platform_name: macOS, os: macos-latest }
- { platform: win, platform_name: Windows, os: windows-latest }
- { platform: linux, platform_name: Linux, os: ubuntu-latest, conda_platform: linux-64 }
- { platform: mac, platform_name: macOS, os: macos-latest, conda_platform: osx-64 }
- { platform: win, platform_name: Windows, os: windows-latest, conda_platform: win-64 }

name: '${{ matrix.cfg.platform_name }} installer'
runs-on: ${{ matrix.cfg.os }}

steps:
- uses: actions/checkout@v3
- uses: s-weigand/setup-conda@v1
# downgrade conda since v23.1.0 is causing issues in "Create Application Server Installer" step
- run: conda install -c conda-forge conda=22.11.1 -y
- run: conda install --file ./workflow_env/conda-${{ matrix.cfg.conda_platform }}.lock -y

- name: Install node
uses: actions/setup-node@v3
Expand All @@ -34,10 +33,8 @@ jobs:
cache: 'yarn'

- name: Install dependencies
# pin Pillow version to prevent Windows build errors
run: |
npm install --global yarn --prefer-offline
conda install -c conda-forge constructor Pillow=9.3.0
yarn install

- name: Check JupyterLab version match
Expand Down Expand Up @@ -73,6 +70,38 @@ jobs:
run: |
yarn create_env_installer:${{ matrix.cfg.platform }}

# contents of tarball needs to be signed for notarization
- name: Codesign Application Server
if: matrix.cfg.platform == 'mac' && steps.release-exists.outputs.result == 'true'
env:
CSC_IDENTITY_AUTO_DISCOVERY: true
CSC_FOR_PULL_REQUEST: true
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
APPLEID: ${{ secrets.APPLEID }}
APPLEIDPASS: ${{ secrets.APPLEIDPASS }}
ENV_INSTALLER_KEYCHAIN_PASS: ${{ secrets.ENV_INSTALLER_KEYCHAIN_PASS }}
run: |
echo "Extracting env installer"
yarn extract_env_installer:${{ matrix.cfg.platform }}
echo $CSC_LINK | base64 -d -o certificate.p12
security create-keychain -p $ENV_INSTALLER_KEYCHAIN_PASS build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p $ENV_INSTALLER_KEYCHAIN_PASS build.keychain
security import certificate.p12 -k build.keychain -P $CSC_KEY_PASSWORD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $ENV_INSTALLER_KEYCHAIN_PASS build.keychain
echo "Signing env binaries"
while read line; do /usr/bin/codesign --force --options=runtime --deep -s "Developer ID Application" ./env_installer/jlab_server_extracted/"$line" -v; done < ./env_installer/sign-osx-64.txt
rm certificate.p12
security delete-keychain build.keychain

# recreate tarball after signing contents
- name: Re-archive Application Server Installer
if: matrix.cfg.platform == 'mac' && steps.release-exists.outputs.result == 'true'
run: |
yarn compress_env_installer:${{ matrix.cfg.platform }}
rm -rf ./env_installer/jlab_server_extracted

- name: Create Application Installer for Test
env:
CSC_IDENTITY_AUTO_DISCOVERY: false # disable code signing if not release asset
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,4 @@ __pycache__
.idea/
*.log

env_installer/
!env_installer/construct.yaml

env_installer/jlab_server/
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@
# ms IDE stuff
.history/
.vscode/

env_installer
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build/**/*
env_installer
14 changes: 6 additions & 8 deletions Release.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,21 @@ If the JupyterLab version is not changing with the new JupyterLab Desktop releas

In order to change the JupyterLab version bundled with the application:

1. Update all `@jupyterlab` package dependencies in [package.json](package.json) using
1. Bump the application version using `tbump` to `new-jlab-version-1`

```bash
yarn set_jupyterlab_version <new-jlab-version>
tbump --only-patch <new-jlab-version>-1
```

`<new-jlab-version>` must match a released JupyterLab version such as `3.1.13`. This command will update dependencies with `@jupyterlab` scope.

2. Bump the application version using `tbump` to `new-jlab-version-1`
2. Update conda lock files using

```bash
tbump --only-patch <new-jlab-version>-1
yarn update_conda_lock
```

3. Update `@jupyter-widgets/jupyterlab-manager` version in [package.json](package.json) for ipywidgets if a compatible newer version is available.
3. If python version is updated in [`env_installer/jlab_server.yaml`](env_installer/jlab_server.yaml), also update `pythonBin` variables in [`util.ts`](src/main/utils.ts) that are used in code signing related methods.

4. Update `ipywidgets` python package version in [`env_installer/construct.yaml`](env_installer/construct.yaml) if there is a compatible newer version available.
4. Update `ipywidgets` python package version in [`env_installer/jlab_server.yaml`](env_installer/jlab_server.yaml) if there is a compatible newer version available.

Note that after updating the bundled JupyterLab version, it is necessary to bump JupyterLab Desktop version using `tbump` as described in the section below. Run `check_version_match` script before committing the changes to ensure version integrity.

Expand Down
4 changes: 2 additions & 2 deletions dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

You can install `conda` as part of a [Miniforge](https://github.com/conda-forge/miniforge) installer.

- [(conda) Constructor](https://github.com/conda/constructor) to bundle JupyterLab Desktop Server into the stand-alone application. You can install Constructor using:
- [conda pack](https://github.com/conda/conda-pack) and [conda lock](https://github.com/conda/conda-lock) to bundle JupyterLab Desktop Server into the standalone application and to create lock files. You can install them using:

```bash
conda install -c conda-forge constructor
conda install -c conda-forge conda-pack conda-lock
```

- nodejs
Expand Down
Loading