style95 commented on code in PR #5361: URL: https://github.com/apache/openwhisk/pull/5361#discussion_r1049127546
########## .github/workflows/0-on-demand.yaml: ########## @@ -0,0 +1,94 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +name: On Demand Tests + +on: + workflow_dispatch: + inputs: + enable_ngrok_debug: + description: "Enable Ngrok Debugging" + required: true + type: boolean + default: false + test_suite: + description: Select Test Suite to run + type: choice + options: + - Unit + - System + - MultiRuntime + - Standalone + - Scheduler + - Performance + ## Uncomment those to debug the build + - Dummy + #- DummyKO + +env: + # openwhisk env + TEST_SUITE: ${{ inputs.test_suite }} + ANSIBLE_CMD: "ansible-playbook -i environments/local -e docker_image_prefix=testing" + GRADLE_PROJS_SKIP: "" + + # (optional) slack incoming wehbook for notifications + SLACK_WEBHOOK: ${{secrets.SLACK_WEBHOOK}} + + # (optional) s3 log upload + AWS_BUCKET: ${{ secrets.AWS_BUCKET }} Review Comment: Same for NGROK, so now contributors are in charge of uploading logs to their own environment to figure out the failed tests of a PR. For periodic tests against the upstream master branch, those who have permission can configure proper secrets for the upstream repo. It needs to be discussed where to place such logs. ########## tools/github/runDummyTests.sh: ########## @@ -0,0 +1,26 @@ +#!/usr/bin/env bash Review Comment: What is the purpose of this? Seems it's being used here. https://github.com/apache/openwhisk/pull/5361/files#diff-fc5257f5200a46b6baab3ca657b694cc84dc77e3a5f9d71062b25fce994c02b4R70 ########## tools/github/setup.sh: ########## @@ -0,0 +1,79 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +#if [[ $TEST_SUITE =~ Dummy ]] Review Comment: This might need to be deleted? ########## tools/github/runDummyKOTests.sh: ########## @@ -0,0 +1,26 @@ +#!/usr/bin/env bash Review Comment: Is this being used? ########## .github/workflows/README.md: ########## @@ -0,0 +1,56 @@ +# How to use those workflows + +There are a few [GitHub secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) to configure to fully leverage the build. + +You can use and set the followings secrets also in your fork. + +## Ngrok Debugging + +You can debug a GitHub Action build using [NGROK](https://ngrok.com/). + +It is disabled for automated build triggered by push and pull_requests. + +You can trigger a workflow run manually enabling ngrok debugging. + +It will open an ssh connection to the VM and keep it up and running for one hour. +The connection url is showns in the log for debugAction.sh + +You can then connect to the build vm, and debug it. +You need to use a password of your choice to access it. + +You can continue the build with `touch /tmp/continue`. +You can abort the build with `touch /tmp/abort`. + +To enable this option you have to register to Ngrok, using the fee account and get the NGROK Token. + +Then set the following secrets: + +- `NGROK_TOKEN` to the ngrok token. +- `NGROK_PASSWORD` to a password of choice to access the build with the ssh command generated. + +## Log Upload + +The build uploads the logs to an s3 bucket allowing to inspect them with a browser. + +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 +``` + +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. + +## Slack notification + +If you want to get notified of what happens on slack, create an [Incoming Web Hook](https://api.slack.com/messaging/webhooks) and then set the following secret: + +- `SLACK_WEBHOOK`: the incoming webhook url provided by slack. Review Comment: I think this is also same. It would be great to discuss how/whether to configure this for the upstream repo. ########## tools/github/setup.sh: ########## @@ -0,0 +1,79 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +#if [[ $TEST_SUITE =~ Dummy ]] +#then echo skipping setup ; exit 0 +#fi + +# retries a command for five times and exits with the non-zero exit if even after +# the retries the command did not succeed. +function retry() { + local exitcode=0 + for i in {1..5}; + do + exitcode=0 + "$@" && break || exitcode=$? && echo "$i. attempt failed. Will retry $((5-i)) more times!" && sleep 1; + done + if [ $exitcode -ne 0 ]; then + exit $exitcode + fi +} + +# setup docker to listen in port 4243 +sudo systemctl stop docker +sudo sed -i -e 's!/usr/bin/dockerd -H fd://!/usr/bin/dockerd -H tcp://0.0.0.0:4243 -H fd://!' /lib/systemd/system/docker.service Review Comment: I faintly remember we decided not to open this port for the docker engine. Does any test fail without this port? ########## .github/workflows/0-on-demand.yaml: ########## @@ -0,0 +1,94 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +name: On Demand Tests + +on: + workflow_dispatch: + inputs: + enable_ngrok_debug: Review Comment: What is the expected behavior for contributors to enable this debugging? Are they supposed to set up a secret in their forked repo, enable this input, and run tests in their repo? Since the secret is not configured in the upstream repo, no debugging would be enabled in the upstream repo, right? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@openwhisk.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org