Skip to content

Commit

Permalink
update the fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
msciabarra committed Feb 10, 2024
1 parent aebe041 commit ce293b6
Show file tree
Hide file tree
Showing 13 changed files with 105 additions and 85 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/0-on-demand.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ on:
- Standalone
- Scheduler
- Performance
## Uncomment those to debug the build
- Dummy
- DummyKO

env:
# openwhisk env
Expand All @@ -49,10 +47,10 @@ env:
SLACK_WEBHOOK: ${{secrets.SLACK_WEBHOOK}}

# (optional) s3 log upload
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
LOG_BUCKET: ${{ secrets.LOG_BUCKET }}
LOG_ACCESS_KEY_ID: ${{ secrets.LOG_ACCESS_KEY_ID }}
LOG_SECRET_ACCESS_KEY: ${{ secrets.LOG_SECRET_ACCESS_KEY }}
LOG_REGION: ${{ secrets.LOG_REGION }}

# github
GH_BUILD: ${{ github.event_name }}-${{ github.sha }}
Expand All @@ -76,7 +74,7 @@ jobs:
run: "./tools/github/run${{ env.TEST_SUITE }}Tests.sh"
continue-on-error: true
- id: logs
name: Upload Logs
name: Show results and Upload logs
run: ./tools/github/checkAndUploadLogs.sh ${{ env.TEST_SUITE }}
- name: Slack Notification
run: >
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/1-unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ name: Unit Tests
on:
# build on push
push:
#tags: '*'
#branches-ignore: '*'
tags:
- '*unit*'
- '*all*'
branches-ignore: '*'
# build on pull requests
pull_request:

Expand All @@ -36,14 +38,19 @@ env:
SLACK_WEBHOOK: ${{secrets.SLACK_WEBHOOK}}

# (optional) s3 log upload
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
LOG_BUCKET: ${{ secrets.LOG_BUCKET }}
LOG_ACCESS_KEY_ID: ${{ secrets.LOG_ACCESS_KEY_ID }}
LOG_SECRET_ACCESS_KEY: ${{ secrets.LOG_SECRET_ACCESS_KEY }}
LOG_REGION: ${{ secrets.LOG_REGION }}

# some tests need also this even if they are empty on pull_requests...
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}

# github
GH_BUILD: ${{ github.event_name }}-${{ github.sha }}
GH_BRANCH: ${{ github.head_ref || github.ref_name }}
GH_BRANCH: ${{ github.head_ref || github.ref_name }}

jobs:
openwhisk:
Expand All @@ -58,10 +65,10 @@ jobs:
run: "./tools/github/run${{ env.TEST_SUITE }}Tests.sh"
continue-on-error: true
- id: logs
name: Upload Logs
name: Show results and Upload logs
run: ./tools/github/checkAndUploadLogs.sh ${{ env.TEST_SUITE }}
- name: Slack Notification
run: >
run: >
./tools/github/writeOnSlack.sh
"[$TEST_SUITE]" ${{ steps.tests.outcome }} on ${GH_BUILD}
$'\nbranch:' $GH_BRANCH
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/2-system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ name: System Tests
on:
# build on push
push:
tags:
- '*sys*'
- '*all*'
branches-ignore: '*'
# build on pull requests
#tags: '*'
#branches-ignore: '*'

pull_request:

env:
Expand All @@ -37,14 +38,14 @@ env:
SLACK_WEBHOOK: ${{secrets.SLACK_WEBHOOK}}

# (optional) s3 log upload
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
LOG_BUCKET: ${{ secrets.LOG_BUCKET }}
LOG_ACCESS_KEY_ID: ${{ secrets.LOG_ACCESS_KEY_ID }}
LOG_SECRET_ACCESS_KEY: ${{ secrets.LOG_SECRET_ACCESS_KEY }}
LOG_REGION: ${{ secrets.LOG_REGION }}

# github
GH_BUILD: ${{ github.event_name }}-${{ github.sha }}
GH_BRANCH: ${{ github.head_ref || github.ref_name }}
GH_BRANCH: ${{ github.head_ref || github.ref_name }}

jobs:
openwhisk:
Expand All @@ -59,10 +60,10 @@ jobs:
run: "./tools/github/run${{ env.TEST_SUITE }}Tests.sh"
continue-on-error: true
- id: logs
name: Upload Logs
name: Show results and Upload logs
run: ./tools/github/checkAndUploadLogs.sh ${{ env.TEST_SUITE }}
- name: Slack Notification
run: >
run: >
./tools/github/writeOnSlack.sh
"[$TEST_SUITE]" ${{ steps.tests.outcome }} on ${GH_BUILD}
$'\nbranch:' $GH_BRANCH
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/3-multi-runtime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ name: MultiRuntime Tests
on:
# build on push
push:
#tags: '*'
#branches-ignore: '*'
tags:
- '*multi*'
- '*all*'

branches-ignore: '*'
# build on pull requests
pull_request:

Expand All @@ -37,14 +39,14 @@ env:
SLACK_WEBHOOK: ${{secrets.SLACK_WEBHOOK}}

# (optional) s3 log upload
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
LOG_BUCKET: ${{ secrets.LOG_BUCKET }}
LOG_ACCESS_KEY_ID: ${{ secrets.LOG_ACCESS_KEY_ID }}
LOG_SECRET_ACCESS_KEY: ${{ secrets.LOG_SECRET_ACCESS_KEY }}
LOG_REGION: ${{ secrets.LOG_REGION }}

# github
GH_BUILD: ${{ github.event_name }}-${{ github.sha }}
GH_BRANCH: ${{ github.head_ref || github.ref_name }}
GH_BRANCH: ${{ github.head_ref || github.ref_name }}

jobs:
openwhisk:
Expand All @@ -59,10 +61,10 @@ jobs:
run: "./tools/github/run${{ env.TEST_SUITE }}Tests.sh"
continue-on-error: true
- id: logs
name: Upload Logs
name: Show results and Upload logs
run: ./tools/github/checkAndUploadLogs.sh ${{ env.TEST_SUITE }}
- name: Slack Notification
run: >
run: >
./tools/github/writeOnSlack.sh
"[$TEST_SUITE]" ${{ steps.tests.outcome }} on ${GH_BUILD}
$'\nbranch:' $GH_BRANCH
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/4-standalone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ name: Standalone Tests
on:
# build on push
push:
tags:
- '*stand*'
- '*all*'
branches-ignore: '*'
# build on pull requests
#tags: '*'
#branches-ignore: '*'

pull_request:

env:
Expand All @@ -37,14 +38,14 @@ env:
SLACK_WEBHOOK: ${{secrets.SLACK_WEBHOOK}}

# (optional) s3 log upload
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
LOG_BUCKET: ${{ secrets.LOG_BUCKET }}
LOG_ACCESS_KEY_ID: ${{ secrets.LOG_ACCESS_KEY_ID }}
LOG_SECRET_ACCESS_KEY: ${{ secrets.LOG_SECRET_ACCESS_KEY }}
LOG_REGION: ${{ secrets.LOG_REGION }}

# github
GH_BUILD: ${{ github.event_name }}-${{ github.sha }}
GH_BRANCH: ${{ github.head_ref || github.ref_name }}
GH_BRANCH: ${{ github.head_ref || github.ref_name }}

jobs:
openwhisk:
Expand All @@ -59,10 +60,10 @@ jobs:
run: "./tools/github/run${{ env.TEST_SUITE }}Tests.sh"
continue-on-error: true
- id: logs
name: Upload Logs
name: Show results and Upload logs
run: ./tools/github/checkAndUploadLogs.sh ${{ env.TEST_SUITE }}
- name: Slack Notification
run: >
run: >
./tools/github/writeOnSlack.sh
"[$TEST_SUITE]" ${{ steps.tests.outcome }} on ${GH_BUILD}
$'\nbranch:' $GH_BRANCH
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/5-scheduler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ name: Scheduler Tests
on:
# build on push
push:
tags:
- '*sched*'
- '*all*'
branches-ignore: '*'
# build on pull requests
#tags: '*'
#branches-ignore: '*'

pull_request:

env:
Expand All @@ -37,14 +38,14 @@ env:
SLACK_WEBHOOK: ${{secrets.SLACK_WEBHOOK}}

# (optional) s3 log upload
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
LOG_BUCKET: ${{ secrets.LOG_BUCKET }}
LOG_ACCESS_KEY_ID: ${{ secrets.LOG_ACCESS_KEY_ID }}
LOG_SECRET_ACCESS_KEY: ${{ secrets.LOG_SECRET_ACCESS_KEY }}
LOG_REGION: ${{ secrets.LOG_REGION }}

# github
GH_BUILD: ${{ github.event_name }}-${{ github.sha }}
GH_BRANCH: ${{ github.head_ref || github.ref_name }}
GH_BRANCH: ${{ github.head_ref || github.ref_name }}

jobs:
openwhisk:
Expand All @@ -59,10 +60,10 @@ jobs:
run: "./tools/github/run${{ env.TEST_SUITE }}Tests.sh"
continue-on-error: true
- id: logs
name: Upload Logs
name: Show results and Upload logs
run: ./tools/github/checkAndUploadLogs.sh ${{ env.TEST_SUITE }}
- name: Slack Notification
run: >
run: >
./tools/github/writeOnSlack.sh
"[$TEST_SUITE]" ${{ steps.tests.outcome }} on ${GH_BUILD}
$'\nbranch:' $GH_BRANCH
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/6-performance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ name: Performance Tests
on:
# build on push
push:
tags:
- '*perf*'
- '*all*'
branches-ignore: '*'
# build on pull requests
#tags: '*'
#ranches-ignore: '*'

pull_request:

env:
Expand All @@ -37,14 +38,14 @@ env:
SLACK_WEBHOOK: ${{secrets.SLACK_WEBHOOK}}

# (optional) s3 log upload
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
LOG_BUCKET: ${{ secrets.LOG_BUCKET }}
LOG_ACCESS_KEY_ID: ${{ secrets.LOG_ACCESS_KEY_ID }}
LOG_SECRET_ACCESS_KEY: ${{ secrets.LOG_SECRET_ACCESS_KEY }}
LOG_REGION: ${{ secrets.LOG_REGION }}

# github
GH_BUILD: ${{ github.event_name }}-${{ github.sha }}
GH_BRANCH: ${{ github.head_ref || github.ref_name }}
GH_BRANCH: ${{ github.head_ref || github.ref_name }}

jobs:
openwhisk:
Expand Down Expand Up @@ -79,7 +80,7 @@ jobs:
- run: OPENWHISK_HOST="172.17.0.1" USERS="1" REQUESTS_PER_SEC="1" ./gradlew gatlingRun-org.apache.openwhisk.ColdBlockingInvokeSimulation
continue-on-error: true
- name: Slack Notification
run: >
run: >
./tools/github/writeOnSlack.sh
"[$TEST_SUITE]" ${{ steps.tests.outcome }} on ${GH_BUILD}
$'\nbranch:' $GH_BRANCH
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ The build uploads the logs to an s3 bucket allowing to inspect them with a brows
You need to create the bucket with the following commands:

```
AWS_BUCKET=<name-of-your-bucket>
AWS_REGION=<the-region-you-use>
aws s3 mb s3://$AWS_BUCKET --region $AWS_REGION
aws s3 website s3://$AWS_BUCKET/ --index-document index.html
aws s3api put-bucket-acl --acl public-read --bucket $AWS_BUCKET
LOG_BUCKET=<name-of-your-bucket>
LOG_REGION=<the-region-you-use>
aws s3 mb s3://$LOG_BUCKET --region $LOG_REGION
aws s3 website s3://$LOG_BUCKET/ --index-document index.html
aws s3api put-bucket-acl --acl public-read --bucket $LOG_BUCKET
```

To enable upload to the created bucket you need to set the following secrets:

- `AWS_BUCKET`: name of your bucket in s3 (just the name, without `s3://`); create it before.
- `AWS_ACCESS_KEY_ID`: your aws access key.
- `AWS_SECRET_ACCESS_KEY`: your aws secret key.
- `AWS_REGION`: important: the region where your bucket is.
- `LOG_BUCKET`: name of your bucket in s3 (just the name, without `s3://`); create it before.
- `LOG_ACCESS_KEY_ID`: your aws access key.
- `LOG_SECRET_ACCESS_KEY`: your aws secret key.
- `LOG_REGION`: important: the region where your bucket is.

## Slack notification

Expand Down
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
version: '3'

vars:
BASETAG: 0.3.0-morpheus
BASETAG: 3.1.0-mastrogpt
TAG:
sh: git describe --tags --abbrev=0 2>/dev/null || echo "no-tag"
TIMESTAMP:
Expand Down
10 changes: 7 additions & 3 deletions tools/github/checkAndUploadLogs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@
# limitations under the License.
#

# showing test results on the CI log
INDEX="tests/build/reports/tests/testCoverageLean/index.html"
test -f "$INDEX" && lynx -dump file://$PWD/$INDEX | grep .

# check variables
for i in AWS_BUCKET AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_REGION
for i in LOG_BUCKET LOG_ACCESS_KEY_ID LOG_SECRET_ACCESS_KEY LOG_REGION
do
if test -z "${!i}"
then echo "Required Environment Variable Missing: $i" ; exit 1
then echo "Required Environment Variable Missing: $i" ; exit 0
fi
done

Expand All @@ -42,7 +46,7 @@ TAGS=""
[[ "$2" == "Unit" ]] && TAGS="db"

LOG_DIR="$(date +%Y-%m-%d)/${LOG_NAME}-${GH_BUILD}-${GH_BRANCH}"
BUCKET_URL="https://$AWS_BUCKET.s3.$AWS_REGION.amazonaws.com"
BUCKET_URL="https://$LOG_BUCKET.s3.$LOG_REGION.amazonaws.com"

echo "Logs: ${BUCKET_URL}/index.html#${LOG_DIR}/"
echo "Reports: ${BUCKET_URL}/${LOG_DIR}/test-reports/reports/tests/testCoverageLean/index.html"
Expand Down
Loading

0 comments on commit ce293b6

Please sign in to comment.