Updating jenkins jobs #614
Workflow file for this run
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
--- | |
name: Docker Compose Integration | |
on: | |
pull_request: | |
branches: | |
- '**' | |
push: | |
branches: | |
- '**' | |
workflow_dispatch: | |
jobs: | |
integration: | |
strategy: | |
fail-fast: false | |
matrix: | |
env: | |
- { TEST_PROFILE: standalone, HUB_TEST_MARKS: "deployment_standalone or all" } | |
- { TEST_PROFILE: insights, HUB_TEST_MARKS: "deployment_cloud or all" } | |
- { TEST_PROFILE: community, HUB_TEST_MARKS: "deployment_community" } | |
- { TEST_PROFILE: standalone, HUB_TEST_MARKS: "x_repo_search" } | |
- { TEST_PROFILE: standalone, HUB_TEST_MARKS: "iqe_rbac_test" } | |
- { TEST_PROFILE: certified-sync, HUB_TEST_MARKS: "sync" } | |
- { TEST_PROFILE: standalone, HUB_TEST_MARKS: "rbac_parallel_group_1" } | |
- { TEST_PROFILE: standalone, HUB_TEST_MARKS: "rbac_parallel_group_2" } | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: (Linux) Install docker compose | |
run: | | |
curl -L -o /tmp/docker-compose https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-linux-x86_64 | |
install /tmp/docker-compose /usr/local/bin/ | |
- name: sudo apt update | |
run: | | |
sudo apt update | |
- name: Install python requirements and podman | |
run: | | |
sudo apt-get install -y libsasl2-dev python-dev-is-python3 libldap2-dev libssl-dev podman | |
- name: Spin up dev/compose/${{ matrix.env.TEST_PROFILE }}.yaml | |
run: | | |
USER_ID=$(id --user) docker compose -f dev/compose/${{ matrix.env.TEST_PROFILE }}.yaml up --detach | |
- name: Export environment variables to host | |
if: ${{ matrix.env.TEST_PROFILE != 'certified-sync' }} | |
run: | | |
docker compose -f dev/compose/${{ matrix.env.TEST_PROFILE }}.yaml exec manager /bin/bash -c 'env | grep -v -w "HOME"' >> $GITHUB_ENV | |
- name: Export environment variables to host (certified-sync) | |
if: ${{ matrix.env.TEST_PROFILE == 'certified-sync' }} | |
run: | | |
docker compose -f dev/compose/${{ matrix.env.TEST_PROFILE }}.yaml exec standalone-manager /bin/bash -c 'env | grep -v -w "HOME"' >> $GITHUB_ENV | |
- run: cat $GITHUB_ENV | |
- name: Wait for API online status | |
run: | | |
max_runs=10 | |
for i in $(seq 1 $max_runs); do | |
echo "$i: checking api status..." | |
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -u "${{ env.DJANGO_SUPERUSER_USERNAME }}:${{ env.DJANGO_SUPERUSER_PASSWORD }}" -LI http://localhost:5001${{ env.PULP_GALAXY_API_PATH_PREFIX }}pulp/api/v3/status/) | |
echo "$RESPONSE" | |
if [ "$RESPONSE" -ne 200 ]; then | |
echo "API is down. Retrying in 10 seconds..." | |
sleep 10 | |
else | |
echo "API online." | |
exit 0 | |
fi | |
if [ $i -eq $max_runs ]; then | |
echo "Failed to start API after $max_runs retries." | |
exit 1 | |
fi | |
done | |
- name: Install integration requirements | |
run: | | |
pip install -r integration_requirements.txt | |
- name: Run integration tests | |
run: | | |
pytest -v -r sx --color=yes -m '${{ matrix.env.HUB_TEST_MARKS }}' galaxy_ng/tests/integration | |
env: | |
GALAXYKIT_SLEEP_SECONDS_POLLING: ".5" | |
GALAXYKIT_SLEEP_SECONDS_ONETIME: ".5" | |
GALAXYKIT_POLLING_MAX_ATTEMPTS: "50" | |
GALAXY_SLEEP_SECONDS_POLLING: ".5" | |
GALAXY_SLEEP_SECONDS_ONETIME: ".5" | |
GALAXY_POLLING_MAX_ATTEMPTS: "50" | |
- name: Logs | |
if: always() | |
run: | | |
set +e | |
docker ps -a | |
echo ::group::MANAGER_LOGS | |
docker logs --tail=10000 compose-manager-1 | |
docker logs --tail=10000 compose-standalone-manager-1 | |
echo ::endgroup:: | |
echo ::group::WORKER_LOGS | |
docker logs --tail=10000 compose-worker-1 | |
docker logs --tail=10000 compose-standalone-worker-1 | |
echo ::endgroup:: | |
echo ::group::CONTENT_LOGS | |
docker logs --tail=10000 compose-content-1 | |
docker logs --tail=10000 compose-standalone-content-1 | |
echo ::endgroup:: | |
echo ::group::API_LOGS | |
docker logs --tail=10000 compose-api-1 | |
docker logs --tail=10000 compose-standalone-api-1 | |
echo ::endgroup:: | |
echo ::group::DEPENDENCIES | |
docker exec compose-manager-1 bash -c "pip list && pip install pipdeptree && pipdeptree" | |
docker exec compose-standalone-manager-1 bash -c "pip list && pip install pipdeptree && pipdeptree" | |
echo ::endgroup:: |