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

ci: prod rvd tests #465

Merged
merged 32 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
bf77c1f
ci: remove -q flag from grep health check
JeremyTubongbanua Sep 11, 2023
781736b
ci: quotations
JeremyTubongbanua Sep 11, 2023
6149aa4
ci: try this way
JeremyTubongbanua Sep 11, 2023
c15e5c8
ci: quotations
JeremyTubongbanua Sep 11, 2023
06402f4
ci: bruh quotation
JeremyTubongbanua Sep 11, 2023
3bddc44
ci: use `&>` and refactor to all.txt instead of err.txt
JeremyTubongbanua Sep 11, 2023
8e5aa5c
ci: use posix compilation notation `2>&>`
JeremyTubongbanua Sep 12, 2023
ca9ab35
ci: oops
JeremyTubongbanua Sep 12, 2023
7cacbbc
ci: oops v2
JeremyTubongbanua Sep 12, 2023
3b9952c
merge: remote-tracking branch 'upstream/trunk' into jeremy-monitor-st…
JeremyTubongbanua Sep 12, 2023
63ac135
ci: release log /atsign/all.txt
JeremyTubongbanua Sep 12, 2023
99a961a
ci: put it in entry point
JeremyTubongbanua Sep 12, 2023
870f4f7
ci:
JeremyTubongbanua Sep 12, 2023
2b2e319
ci:
JeremyTubongbanua Sep 12, 2023
da564b3
ci: use tee
JeremyTubongbanua Sep 12, 2023
262231e
ci: add q back
JeremyTubongbanua Sep 12, 2023
558fbdf
ci: prod tests
JeremyTubongbanua Sep 13, 2023
952d735
ci: fix composite action
JeremyTubongbanua Sep 13, 2023
e34efeb
ci:
JeremyTubongbanua Sep 13, 2023
b611520
ci: fix keys not echoing
JeremyTubongbanua Sep 13, 2023
fd4920a
ci: fix path
JeremyTubongbanua Sep 13, 2023
6afa986
ci:
JeremyTubongbanua Sep 13, 2023
fffd481
ci:
JeremyTubongbanua Sep 13, 2023
da0db56
ci:
JeremyTubongbanua Sep 13, 2023
79a256d
ci:
JeremyTubongbanua Sep 13, 2023
2478384
ci:
JeremyTubongbanua Sep 13, 2023
13f6591
ci: blank base
JeremyTubongbanua Sep 13, 2023
d77baa8
ci: look for test passed
JeremyTubongbanua Sep 13, 2023
5cf3968
merge: remote-tracking branch 'upstream/jeremy-monitor-started' into …
JeremyTubongbanua Sep 13, 2023
96e8184
chore: comment on: pull_request which was for debugging
JeremyTubongbanua Sep 13, 2023
8939c0e
merge: remote-tracking branch 'upstream/trunk' into jeremy-prod-tests
JeremyTubongbanua Sep 13, 2023
1fb60c4
revert: remove tail stuff
JeremyTubongbanua Sep 13, 2023
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
2 changes: 1 addition & 1 deletion .github/composite/setup_entrypoints/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ runs:
shell: bash
working-directory: tests/end2end_tests/contexts/_init_
run: |
./setup-sshrvd-entrypoint.sh ${{ inputs.sshrvd_atsign }}
./setup-sshrvd-entrypoint.sh ${{ inputs.sshrvd_atsign }} "sshrvd_entrypoint.sh"
163 changes: 163 additions & 0 deletions .github/workflows/prod_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
name: prod_tests

on:
workflow_dispatch:
schedule:
- cron: "2 * * * *" # “At minute 2.” https://crontab.guru
# pull_request: # temporary
# branches:
# - trunk

env:
SSHNP_ATSIGN: "@8incanteater"
SSHNP_ATSIGN_KEYS: ${{ secrets.ATKEYS_8INCANTEATER }}
SSHNPD_ATSIGN: "@8052simple"
SSHNPD_ATSIGN_KEYS: ${{ secrets.ATKEYS_8052SIMPLE }}
SSHRVD_ATSIGN: "@8485wealthy51"
SSHRVD_ATSIGN_KEYS: ${{ secrets.ATKEYS_8485WEALTHY51 }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need SSH*_ATSIGN_KEYS environment variables, that's what the setup keys steps are for down below

SSHRVD_AM_ATSIGN: "@rv_am"
SSHRVD_AP_ATSIGN: "@rv_ap"
SSHRVD_EU_ATSIGN: "@rv_eu"
DOCKER_COMPOSE_BUILD_CMD: "docker compose build"
DOCKER_COMPOSE_UP_CMD: "docker compose up --abort-on-container-exit --timeout 900"

jobs:
e2e_test:
runs-on: ubuntu-latest
strategy:
matrix:
rvd:
# - ${{ env.SSHRVD_ATSIGN }}
# - ${{ env.SSHRVD_AM_ATSIGN }}
# - ${{ env.SSHRVD_AP_ATSIGN }}
# - ${{ env.SSHRVD_EU_ATSIGN }}
- "@8485wealthy51"
- "@rv_am"
- "@rv_ap"
- "@rv_eu"

steps:
- name: Show Matrix Values
run: |
echo "rvd: ${{ matrix.rvd }}"

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Setup NP/NPD key env
run: |
SSHNP_ATKEYS="$(tr '[:lower:]' '[:upper:]' <<< '${{ env.SSHNP_ATSIGN }}')"
echo "SSHNP_ATKEYS=ATKEYS_${SSHNP_ATKEYS:1}" >> $GITHUB_ENV

SSHNPD_ATKEYS="$(tr '[:lower:]' '[:upper:]' <<< '${{ env.SSHNPD_ATSIGN }}')"
echo "SSHNPD_ATKEYS=ATKEYS_${SSHNPD_ATKEYS:1}" >> $GITHUB_ENV

- name: Setup NP/NPD keys
working-directory: tests/end2end_tests/contexts
run: |
echo "${{ secrets[env.SSHNP_ATKEYS] }}" > sshnp/.atsign/keys/${{ env.SSHNP_ATSIGN }}_key.atKeys
echo "${{ secrets[env.SSHNPD_ATKEYS] }}" > sshnpd/.atsign/keys/${{ env.SSHNPD_ATSIGN }}_key.atKeys

- name: Set up NP/NPD entrypoints
working-directory: tests/end2end_tests/contexts/_init_
run: |
./setup-sshnp-entrypoint.sh \
${{ github.run_id }}${{ github.run_attempt }}${{ strategy.job-index }} \
${{ env.SSHNP_ATSIGN }} \
${{ env.SSHNPD_ATSIGN }} \
${{ matrix.rvd }} \
sshnp_entrypoint.sh

./setup-sshnpd-entrypoint.sh \
${{ github.run_id }}${{ github.run_attempt }}${{ strategy.job-index }} \
${{ env.SSHNP_ATSIGN }} \
${{ env.SSHNPD_ATSIGN }} \
sshnpd_entrypoint.sh

- name: Set up RVD keys and entrypoint
if: matrix.rvd == env.SSHRVD_ATSIGN
working-directory: tests/end2end_tests
run: |
# setup keys
echo "${{ env.SSHRVD_ATSIGN_KEYS }}" > contexts/sshrvd/.atsign/keys/${{ env.SSHRVD_ATSIGN }}_key.atKeys

# set up sshrvd entrypoint
cd contexts/_init_
./setup-sshrvd-entrypoint.sh \
${{ matrix.rvd }} \
sshrvd_entrypoint.sh
cd ../sshrvd
cat entrypoint.sh

- name: Ensure entrypoints exist
working-directory: tests/end2end_tests/contexts
run: |
cat sshnp/entrypoint.sh
cat sshnpd/entrypoint.sh

- name: Build docker-compose.yaml
working-directory: tests/end2end_tests/tests
run: |
cat docker-compose-blank-base.yaml > docker-compose.yaml
cat service-image-runtime-release.yaml >> docker-compose.yaml
echo " - release=latest" >> docker-compose.yaml
echo " image: atsigncompany/sshnp-e2e-runtime:latest" >> docker-compose.yaml
cat service-container-sshnp.yaml >> docker-compose.yaml
echo " image: atsigncompany/sshnp-e2e-runtime:latest" >> docker-compose.yaml
echo " depends_on:" >> docker-compose.yaml
echo " - image-runtime-release" >> docker-compose.yaml
echo " - container-sshnpd" >> docker-compose.yaml
if [ "${{ matrix.rvd }}" == "@8485wealthy51" ]; then
echo " - container-sshrvd" >> docker-compose.yaml
fi
cat service-container-sshnpd.yaml >> docker-compose.yaml
echo " image: atsigncompany/sshnp-e2e-runtime:latest" >> docker-compose.yaml
echo " depends_on:" >> docker-compose.yaml
echo " - image-runtime-release" >> docker-compose.yaml
if [ "${{ matrix.rvd }}" == "@8485wealthy51" ]; then
echo " - container-sshrvd" >> docker-compose.yaml
fi

- name: Add RVD service to docker-compose.yaml
if: matrix.rvd == env.SSHRVD_ATSIGN
working-directory: tests/end2end_tests/tests
run: |
cat service-container-sshrvd.yaml >> docker-compose.yaml
echo " image: atsigncompany/sshnp-e2e-runtime:latest" >> docker-compose.yaml
echo " depends_on:" >> docker-compose.yaml
echo " - image-runtime-release" >> docker-compose.yaml

- name: docker-compose.yaml
working-directory: tests/end2end_tests/tests
run: |
cat docker-compose.yaml

- name: Build
working-directory: tests/end2end_tests/tests
run: |
${{ env.DOCKER_COMPOSE_BUILD_CMD }}

- name: Test
working-directory: tests/end2end_tests/tests
run: |
${{ env.DOCKER_COMPOSE_UP_CMD }}

- name: Found "Test Passed" in Logs
if: always()
working-directory: tests/end2end_tests/tests
run: |
docker compose logs --timestamps | grep -q "Test Passed$"

- name: Logs
if: always()
continue-on-error: true # if this fails, do not fail the job
working-directory: tests/end2end_tests/tests
run: |
docker compose ps -a
docker compose logs --timestamps

- name: Tear down
if: always()
continue-on-error: true # if this fails, do not fail the job
working-directory: tests/end2end_tests/tests
run: |
docker compose down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
# example usage: ./setup-sshrvd-entrypoint.sh @alice

sshrvd=$1 # e.g. @alice
template_name=$2

cp ../../entrypoints/sshrvd_entrypoint.sh ../sshrvd/entrypoint.sh # copy template to the mounted folder
cp ../../entrypoints/"$template_name" ../sshrvd/entrypoint.sh # copy template to the mounted folder

prefix="sed -i"

Expand Down
9 changes: 9 additions & 0 deletions tests/end2end_tests/tests/docker-compose-blank-base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: '3'
networks:
sshnp:
driver: bridge
name: atsigncompany/sshnp-e2e-network-sshnp
sshnpd:
driver: bridge
name: atsigncompany/sshnp-e2e-network-sshnpd
services: