Skip to content

Commit

Permalink
Merge pull request #2909 from regro/use-latest
Browse files Browse the repository at this point in the history
ci: pull latest tag for bot-feedstocks job
  • Loading branch information
beckermr authored Aug 5, 2024
2 parents a3b5dbb + d560a99 commit aa5ff4f
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/bot-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
MEMORY_LIMIT_GB: 7
CF_TICK_GRAPH_DATA_BACKENDS: "${{ vars.CF_TICK_GRAPH_DATA_BACKENDS }}"
MONGODB_CONNECTION_STRING: ${{ secrets.MONGODB_CONNECTION_STRING }}
CF_TICK_CONTAINER_TAG: latest

- name: status of changes
if: github.ref == 'refs/heads/master' && always() && ! env.CI_SKIP
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/bot-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
env:
CF_TICK_GRAPH_DATA_BACKENDS: "${{ vars.CF_TICK_GRAPH_DATA_BACKENDS }}"
MONGODB_CONNECTION_STRING: ${{ secrets.MONGODB_CONNECTION_STRING }}
CF_TICK_CONTAINER_TAG: latest

bot-cache-trigger:
needs: bot-cache
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/bot-feedstocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,18 @@ jobs:
shell: bash -leo pipefail {0}

steps:
- name: get latest release
id: latest_release
run: |
tag_name=$(gh api repos/regro/cf-scripts/releases/latest --jq '.tag_name')
echo "latest release: ${tag_name}"
echo "tag_name=${tag_name}" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
ref: ${{ steps.latest_release.outputs.tag_name }}
path: cf-scripts

- uses: mamba-org/setup-micromamba@f8b8a1e23a26f60a44c853292711bacfd3eac822 # v1
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/bot-make-graph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
CF_TICK_GRAPH_DATA_BACKENDS: "${{ vars.CF_TICK_GRAPH_DATA_BACKENDS }}"
MONGODB_CONNECTION_STRING: ${{ secrets.MONGODB_CONNECTION_STRING }}
BOT_JOB: ${{ matrix.job_num }}
CF_TICK_CONTAINER_TAG: latest

- name: deploy
if: github.ref == 'refs/heads/master' && always() && ! env.CI_SKIP
Expand Down Expand Up @@ -113,6 +114,7 @@ jobs:
env:
CF_TICK_GRAPH_DATA_BACKENDS: "${{ vars.CF_TICK_GRAPH_DATA_BACKENDS }}"
MONGODB_CONNECTION_STRING: ${{ secrets.MONGODB_CONNECTION_STRING }}
CF_TICK_CONTAINER_TAG: latest

- name: deploy
if: github.ref == 'refs/heads/master' && always() && ! env.CI_SKIP
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/bot-make-migrators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
env:
CF_TICK_GRAPH_DATA_BACKENDS: "${{ vars.CF_TICK_GRAPH_DATA_BACKENDS }}"
MONGODB_CONNECTION_STRING: ${{ secrets.MONGODB_CONNECTION_STRING }}
CF_TICK_CONTAINER_TAG: latest

- name: deploy
if: github.ref == 'refs/heads/master' && always() && ! env.CI_SKIP
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/bot-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
BOT_JOB: ${{ matrix.job_num }}
CF_TICK_GRAPH_DATA_BACKENDS: "${{ vars.CF_TICK_GRAPH_DATA_BACKENDS }}"
MONGODB_CONNECTION_STRING: ${{ secrets.MONGODB_CONNECTION_STRING }}
CF_TICK_CONTAINER_TAG: latest

- name: deploy
if: github.ref == 'refs/heads/master' && ! cancelled() && ! env.CI_SKIP
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/bot-pypi-mapping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
conda-forge-tick make-import-to-package-mapping
env:
BOT_TOKEN: ${{ secrets.AUTOTICK_BOT_TOKEN }}
CF_TICK_CONTAINER_TAG: latest

- name: build pypi mapping
if: success() && ! env.CI_SKIP
Expand All @@ -54,6 +55,7 @@ jobs:
conda-forge-tick make-mappings
env:
BOT_TOKEN: ${{ secrets.AUTOTICK_BOT_TOKEN }}
CF_TICK_CONTAINER_TAG: latest

- name: deploy
if: github.ref == 'refs/heads/master' && ! cancelled() && ! env.CI_SKIP
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/bot-update-status-page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
conda-forge-tick make-status-report
env:
BOT_TOKEN: ${{ secrets.AUTOTICK_BOT_TOKEN }}
CF_TICK_CONTAINER_TAG: latest

- name: deploy
if: github.ref == 'refs/heads/master' && ! cancelled() && ! env.CI_SKIP
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/bot-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
BOT_JOB: ${{ matrix.job_num }}
CF_TICK_GRAPH_DATA_BACKENDS: "${{ vars.CF_TICK_GRAPH_DATA_BACKENDS }}"
MONGODB_CONNECTION_STRING: ${{ secrets.MONGODB_CONNECTION_STRING }}
CF_TICK_CONTAINER_TAG: latest

- name: deploy
if: github.ref == 'refs/heads/master' && ! cancelled() && ! env.CI_SKIP
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ jobs:

- name: configure conda and install code
run: |
export GIT_FULL_HASH=`git rev-parse HEAD`
export RUN_URL=""
pip install --no-deps --no-build-isolation -e .
- name: test versions
Expand Down Expand Up @@ -86,6 +84,7 @@ jobs:
tests
env:
MONGODB_CONNECTION_STRING: "mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000"
RUN_URL: ""

- name: upload codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ If your migrator needs special configuration, you should write a new factory fun
- `RUN_URL`: set to the URL of the CI build (now set to a GHA run URL)
- `MEMORY_LIMIT_GB`: set to the memory limit in GB for the bot
- `BOT_TOKEN`: a GitHub token for the bot user
- `CF_TICK_CONTAINER_TAG`: set this to override the default container tag used in production runs, otherwise the value of `__version__` is used

### Running Tests

Expand Down Expand Up @@ -356,11 +357,11 @@ This is an important number to know when proposing a migration
### `conda-forge-tick` Container Image and Dockerfile

The bot relies on a container image to run certain tasks. The image is built from the `Dockerfile` in the root of
this repository and hosted via `ghcr.io`. The `latest` tag is used for production jobs and updated automatically
this repository and hosted via `ghcr.io`. The `__version__` tag is used for production jobs and updated automatically
when PRs are merged. The container is typically run via

```bash
docker run --rm -t conda-forge-tick:latest python /opt/autotick-bot/docker/run_bot_task.py <task> <args>
docker run --rm -t conda-forge-tick:<__version__> python /opt/autotick-bot/docker/run_bot_task.py <task> <args>
```

See the [run_bot_task.py](docker/run_bot_task.py) script for more information.
Expand Down
5 changes: 2 additions & 3 deletions autotick-bot/install_bot_code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ sudo apt-get autoclean -y >& /dev/null
sudo docker image prune --all --force
df -h

docker pull ghcr.io/regro/conda-forge-tick:latest

git config --global user.name regro-cf-autotick-bot
git config --global user.email 36490558+regro-cf-autotick-bot@users.noreply.github.com
git config --global pull.rebase false
Expand All @@ -32,7 +30,6 @@ conda update conda-forge-pinning --yes

cd cf-scripts

export GIT_FULL_HASH=$(git rev-parse HEAD)
pip install --no-deps --no-build-isolation -e .

cd ..
Expand All @@ -44,6 +41,8 @@ else
echo "Skipping cloning of cf-graph and pinning feedstock"
fi

docker pull ghcr.io/regro/conda-forge-tick:$(python -c "import conda_forge_tick; print(conda_forge_tick.__version__)")

echo -e "\n\n============================================\n============================================"
conda info
conda config --show-sources
Expand Down
5 changes: 4 additions & 1 deletion conda_forge_tick/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import ruamel.yaml

from . import sensitive_env
from ._version import __version__
from .lazy_json_backends import LazyJson

if typing.TYPE_CHECKING:
Expand Down Expand Up @@ -122,7 +123,9 @@ def get_default_container_name():
if os.environ.get("CF_TICK_PYTEST", "false") == "true":
cname = "conda-forge-tick:test"
else:
cname = "ghcr.io/regro/conda-forge-tick:latest"
cname = "ghcr.io/regro/conda-forge-tick:" + os.environ.get(
"CF_TICK_CONTAINER_TAG", __version__
)

return cname

Expand Down

0 comments on commit aa5ff4f

Please sign in to comment.