Skip to content

Commit 837fc61

Browse files
Add environment.lock and workflow to update it weekly (#641)
1 parent 7878b8b commit 837fc61

File tree

7 files changed

+282
-5
lines changed

7 files changed

+282
-5
lines changed

.github/workflows/build-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- uses: actions/checkout@v4
4343
- uses: mamba-org/setup-micromamba@v1
4444
with:
45-
environment-file: ./environment.yml
45+
environment-file: ./environment.lock
4646
environment-name: sagemaker-distribution
4747
init-shell: bash
4848
- name: Free up disk space

.github/workflows/check-image-size.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- uses: actions/checkout@v4
4242
- uses: mamba-org/setup-micromamba@v1
4343
with:
44-
environment-file: ./environment.yml
44+
environment-file: ./environment.lock
4545
environment-name: sagemaker-distribution
4646
init-shell: bash
4747
- name: Free up disk space

.github/workflows/check_code_quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- uses: actions/checkout@v4
3232
- uses: mamba-org/setup-micromamba@v1
3333
with:
34-
environment-file: ./environment.yml
34+
environment-file: ./environment.lock
3535
environment-name: sagemaker-distribution
3636
init-shell: bash
3737
- name: Free up disk space
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Update environment.lock
2+
# Update environment.lock weekly, so we can quickly install environment without having
3+
# to solve environment.yml every time.
4+
on:
5+
# Every Monday
6+
schedule:
7+
- cron: '0 0 * * MON'
8+
# Manually call
9+
workflow_dispatch:
10+
defaults:
11+
run:
12+
shell: bash -l {0}
13+
jobs:
14+
update-environment:
15+
name: Install environment.yml, generate environment.lock
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: mamba-org/setup-micromamba@v1
22+
with:
23+
environment-file: ./environment.yml
24+
environment-name: sagemaker-distribution
25+
init-shell: bash
26+
- name: Create environment-lock.yml
27+
run: micromamba env export --explicit > environment.lock
28+
- name: Run sagemaker-distribution unit tests to check for regressions
29+
run: pytest -m unit
30+
- name: Commit changes
31+
run: |
32+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
33+
git config --local user.name "github-actions[bot]"
34+
git add environment.lock
35+
git commit -m 'Update environment.lock'
36+
git push

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Follow these steps for sending out a pull request for adding new packages:
6161
```
6262
This project uses Conda to manage its dependencies. Run the following to setup your local environment:
6363
64-
conda env update --file environment.yml -n sagemaker-distribution
64+
conda env update --file environment.lock -n sagemaker-distribution
6565
6666
conda activate sagemaker-distribution
6767

DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This project uses Conda to manage its dependencies. Run the following to setup your local environment:
44

55
```shell
6-
conda env update --file environment.yml -n sagemaker-distribution
6+
conda env update --file environment.lock -n sagemaker-distribution
77
```
88

99
## Tests

environment.lock

Lines changed: 241 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)