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

Add comment bot to report Docker image package versions #290

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 26 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ on:
permissions:
id-token: write
contents: read
pull-requests: write # Required for Sandbox image packages comment bot

jobs:
integration-test:
Expand Down Expand Up @@ -56,6 +57,31 @@ jobs:
cd ./dea-sandbox/integration-testing
CURRENT_UID=1000:100 docker-compose up -d

- name: Extract package versions
run: |
cd ./dea-sandbox/integration-testing
docker-compose exec -T sandbox cat /tmp/requirements.txt > requirements.txt

- name: Read package versions
id: versions
run: |
{
echo 'content<<EOF'
cat ./dea-sandbox/integration-testing/requirements.txt
echo EOF
} >> "$GITHUB_OUTPUT"

# Post package versions as a comment on the PR
- name: Post package versions as a comment
uses: mshick/add-pr-comment@v2
if: github.event_name == 'pull_request'
with:
message: |
### Installed packages:
```
${{ steps.versions.outputs.content }}
```

- name: Set up Datacube and Test
run: |
cd ./dea-sandbox/integration-testing
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ RUN echo "Enable server extensions" \
COPY assets/sync_repo assets/jupyterhub-singleuser /usr/local/bin/
COPY assets/overrides.json /env/share/jupyter/lab/settings/

RUN pip list --format=freeze
RUN pip list --format=freeze > /tmp/requirements.txt

WORKDIR "/home/$nb_user"
ENTRYPOINT ["/env/bin/tini", "--"]
Expand Down
Loading