-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from lsst/tickets/PREOPS-4607
PREOPS-4607 update dependencies to rubin-scheduler instead of rubin-sim
- Loading branch information
Showing
48 changed files
with
423 additions
and
4,867 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,86 @@ | ||
name: build docker image | ||
name: Build docker image | ||
|
||
"on": | ||
workflow_dispatch: | ||
|
||
# Follows https://github.com/lsst-sqre/build-and-push-to-ghcr | ||
|
||
jobs: | ||
build: | ||
build_container: | ||
runs-on: ubuntu-latest | ||
|
||
# See https://lsstc.slack.com/archives/C2JP8GGVC/p1698782669757349?thread_ts=1698779230.846079&cid=C2JP8GGVC | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
# We need to install schedview in this workflow to get the data | ||
# for rubin_sim, as download by rs_download_data or cached by github. | ||
- uses: actions/checkout@v4 | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
python-version: "3.11" | ||
auto-update-conda: true | ||
channels: conda-forge,defaults | ||
miniforge-variant: Mambaforge | ||
use-mamba: true | ||
channel-priority: strict | ||
show-channel-urls: true | ||
|
||
- name: configure conda and install requirements | ||
- name: Configure conda and install requirements | ||
id: rs-install | ||
shell: bash -l {0} | ||
run: | | ||
mamba install --quiet --file=requirements.txt | ||
mamba install --quiet --file=test-requirements.txt | ||
mamba list rubin-sim | grep -v "#" | awk '{print $2}' > ${{ github.workspace }}/rs_version | ||
mamba list rubin-scheduler | grep -v "#" | awk '{print $2}' > ${{ github.workspace }}/rs_version | ||
echo "rs-version" `cat ${{ github.workspace }}/rs_version` | ||
echo "rs-version=`cat ${{ github.workspace }}/rs_version`" >> $GITHUB_OUTPUT | ||
echo "rs-version=`cat ${{ github.workspace }}/rs_version`" >> $GITHUB_OUTPUT | ||
- name: Access rubin-sim-data cache | ||
- name: Access rubin-sched-data cache | ||
id: cache-rs | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cached-rubin-sim-data | ||
cache-name: cached-rubin-sched-data | ||
with: | ||
path: ${{ github.workspace }}/rubin_sim_data | ||
path: ~/rubin_sim_data | ||
key: ${{ env.cache-name }}-v${{ steps.rs-install.outputs.rs-version }} | ||
restore-keys: | | ||
${{ env.cache-name }}-v | ||
- if: ${{ steps.cache-rs.outputs.cache-hit == 'true' }} | ||
name: List cache contents. | ||
shell: bash -l {0} | ||
run: | | ||
export RUBIN_SIM_DATA_DIR=${{ github.workspace }}/rubin_sim_data | ||
echo $RUBIN_SIM_DATA_DIR | ||
ls $RUBIN_SIM_DATA_DIR | ||
echo "__contents of versions.txt__" | ||
cat $RUBIN_SIM_DATA_DIR/versions.txt | ||
- if: ${{ steps.cache-rs.outputs.cache-hit != 'true' }} | ||
name: Download data. | ||
- name: Check and update cache contents. | ||
shell: bash -l {0} | ||
run: | | ||
export RUBIN_SIM_DATA_DIR=${{ github.workspace }}/rubin_sim_data | ||
rs_download_data --force --dirs scheduler,site_models,skybrightness_pre,throughputs,tests --tdqm_disable | ||
export RUBIN_SIM_DATA_DIR=~/rubin_sim_data | ||
scheduler_download_data --update --tdqm_disable | ||
# Docker image copies from github.workspace, not ~ | ||
cp -r ~/rubin_sim_data ${{ github.workspace }}/rubin_sim_data | ||
- name: report environment | ||
- name: Report environment | ||
shell: bash -l {0} | ||
run: | | ||
echo pwd is `pwd` | ||
echo python is `which python` | ||
echo github.workspace is ${{ github.workspace }} | ||
find ${{ github.workspace }} -maxdepth 2 | ||
- uses: lsst-sqre/build-and-push-to-ghcr@v1 | ||
- uses: lsst-sqre/build-and-push-to-ghcr@tickets/DM-41857 | ||
id: build | ||
with: | ||
image: ${{ github.repository }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
dockerfile: Dockerfile | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
|
||
- name: Report build outputs | ||
shell: bash -l {0} | ||
run: | | ||
echo Pushed ghcr.io/${{ github.repository }}:${{ steps.build.outputs.tag }} | ||
echo Fully qualified image digest: ${{ steps.build.outputs.fully_qualified_image_digest }} | ||
echo Tag of the image: ${{ steps.build.outputs.tag }} | ||
- run: echo Pushed ghcr.io/${{ github.repository }}:${{ steps.build.outputs.tag }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Auto cleanup cache for branch | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
|
||
jobs: | ||
cleanup-cache: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cleanup | ||
run: | | ||
gh extension install actions/gh-actions-cache | ||
echo "Fetching list of cache key" | ||
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1) | ||
## Setting this to not fail the workflow while deleting cache keys. | ||
set +e | ||
echo "Deleting caches..." | ||
for cacheKey in $cacheKeysForPR | ||
do | ||
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm | ||
done | ||
echo "Done" | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
REPO: ${{ github.repository }} | ||
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Ruff and iSort | ||
on: | ||
# Trigger the workflow on push (to main) or pull request | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
isort: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: isort/isort-action@v1 | ||
with: | ||
requirements-files: "requirements.txt test-requirements.txt" | ||
ruff: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: chartboost/ruff-action@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@Library('JenkinsShared')_ | ||
ExternalCondaPipeline("schedview") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.