1+ name : Create nightly Coiled software environments
2+
3+ on :
4+ schedule :
5+ # Runs at 01:00 every day after pre-release
6+ - cron : " 0 1 * * *"
7+
8+ jobs :
9+ build :
10+ name : Python ${{ matrix.python-version }}, nightly build, ${{ matrix.server }}
11+ runs-on : ubuntu-latest
12+ strategy :
13+ fail-fast : false
14+ matrix :
15+ python-version : ["3.8", "3.9", "3.10"]
16+ server : ["https://staging.coiledhq.com"]
17+ include : # leaving this logic as we build nightly soft env for prod.
18+ - server : " https://staging.coiledhq.com"
19+ token-name : COILED_STAGING_BENCHMARK_BOT_TOKEN
20+
21+ steps :
22+ - name : Checkout source
23+ uses : actions/checkout@v2
24+
25+ - name : Set up Python
26+ uses : actions/setup-python@v1
27+
28+ - name : Install Coiled
29+ run : python -m pip install coiled
30+
31+ - name : Create environment variables
32+ run : |
33+ # conda search for the coiled-runtime latest nightly
34+ arr_nightly=($(conda search --override-channels -c coiled/label/dev coiled-runtime | tail -n 1))
35+
36+ # extract coiled-runtime nightly version / build
37+ export RUNTIME_NIGHTLY_VERSION=${arr_nightly[1]}
38+ export RUNTIME_NIGHTLY_VERSION_FORMATTED=$(echo $RUNTIME_NIGHTLY_VERSION | sed 's/\./-/g' )
39+ echo "Latest coiled-runtime nightly version formatted $RUNTIME_NIGHTLY_VERSION_FORMATTED"
40+
41+ # Coiled software environment names can't contain "." or uppercase characters
42+ export PYTHON_VERSION_FORMATTED=$(echo "${{ matrix.python-version }}" | sed 's/\.//g' )
43+ export COILED_SOFTWARE_ENV_NAME=coiled-runtime-$RUNTIME_NIGHTLY_VERSION_FORMATTED-py$PYTHON_VERSION_FORMATTED
44+ export ENV_FILENAME=coiled-runtime-nightly-py$PYTHON_VERSION_FORMATTED
45+
46+ # Put variables into $GITHUB_ENV so it can be used in subsequent workflow steps
47+ echo COILED_SOFTWARE_ENV_NAME=$COILED_SOFTWARE_ENV_NAME >> $GITHUB_ENV
48+ echo ENV_FILENAME=$ENV_FILENAME >> $GITHUB_ENV
49+ echo RUNTIME_NIGHTLY_VERSION=$RUNTIME_NIGHTLY_VERSION >> $GITHUB_ENV
50+
51+ - name : Pin latest nightly coiled-runtime
52+ uses : jacobtomlinson/gha-find-replace@v2
53+ with :
54+ include : " environments/coiled-runtime-nightly-*.yml"
55+ find : " coiled-runtime"
56+ replace : " coiled-runtime=${{ env.RUNTIME_NIGHTLY_VERSION }}"
57+
58+ - name : Login to DockerHub
59+ uses : docker/login-action@v2
60+ with :
61+ username : ${{ secrets.DOCKER_HUB_USERNAME }}
62+ password : ${{ secrets.DOCKER_HUB_TOKEN }}
63+
64+ - name : Build and push runtime nightly ${{ env.RUNTIME_NIGHTLY_VERSION }} python ${{ matrix.python-version }}
65+ uses : docker/build-push-action@v3
66+ with :
67+ push : true
68+ tags : coiled/coiled-runtime:nightly-${{ env.RUNTIME_NIGHTLY_VERSION }}-py${{ matrix.python-version }}
69+ build-args : ENV_FILENAME=${{ env.ENV_FILENAME }}
70+
71+ - name : Create Runtime ${{ env.RUNTIME_NIGHTLY_VERSION}}, Python ${{ matrix.python-version }}, Server ${{ matrix.server }} software environment
72+ env :
73+ DASK_COILED__SERVER : ${{ matrix.server }}
74+ DASK_COILED__TOKEN : ${{ secrets[matrix.token-name] }}
75+ run : |
76+ coiled env create --name coiled/${{ env.COILED_SOFTWARE_ENV_NAME }} --container coiled/coiled-runtime:nightly-${{ env.RUNTIME_NIGHTLY_VERSION }}-py${{ matrix.python-version }}
0 commit comments