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

[Dogfooding] Create website deploy previews for PRs using odo deploy #6871

Conversation

rm3l
Copy link
Member

@rm3l rm3l commented Jun 6, 2023

What type of PR is this:
/area testing

What does this PR do / why we need it:
This is a follow-up to the Dogfooding idea started with #6564
I wanted to take this opportunity to try odo as an outer-loop tool from a user perspective.
This PR adds a 'deploy' command to the website Devfile, and adds a GitHub Workflow that is triggered on PR events, and uses this Devfile to run odo deploy against our internal Kubernetes cluster, in order to create Deploy Previews for PRs (similar to what Netlify currently does).
Once a PR is open, a dedicated namespace is created, and odo deploy is run against it. If deployment is successful (and the preview URL is reachable), a comment with the preview URL is automatically added to the PR.
Once a PR is closed, the dedicated namespace is deleted.

NOTE: for security purposes, PRs from external forks will need a manual review and approval to be deployed (because this operation requires access to the GitHub Repository Secrets).

Examples of such PRs:

Which issue(s) this PR fixes:
DevTools week idea.

PR acceptance criteria:

  • Unit test

  • Integration test

  • Documentation

How to test changes / Special notes to the reviewer:

  • Locally:
    You should be able to run odo deploy from the docs/website folder.
    Note that this leverages the Image Name as selector feature to keep the Devfile portable. That is, the container image used in the image component is relative, and will be substituted in all matching components accordingly. For this to work, you need to set the ImageRegistry preference, e.g.:
# Make sure you are logged into the registry
# Set the ImageRegistry preference, e.g.:
$ odo preference set ImageRegistry quay.io/$USER
$ cd docs/website
$ odo deploy --var DEPLOY_INGRESS_DOMAIN=<ingressDomain, e.g.: 127.0.0.1.nip.io or ${minikubeIp}.nip.io>
# Access the URL accessible via the Ingress resource reported by this command:
$ odo describe component
  • Once this PR is merged in, any PRs updating the website will be deployed into our test Kubernetes cluster, and a comment with the preview URL will be added to the PR.

@openshift-ci
Copy link

openshift-ci bot commented Jun 6, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. label Jun 6, 2023
@netlify
Copy link

netlify bot commented Jun 6, 2023

🔨 Deploy Preview deleted from internal cluster!

Name Link
🔨 Latest commit 0a3d2dc
😎 Deploy Preview https://odo-dev-pr-6871.odo-test-kubernetes-clust-49529fc6e6a4a9fe7ebba9a3db5b55c4-0000.eu-de.containers.appdomain.cloud/

@odo-robot
Copy link

odo-robot bot commented Jun 6, 2023

Kubernetes Docs Tests on commit 63c8e27 finished with errors.
View logs: TXT HTML

@rm3l rm3l force-pushed the devtools_weeks/062023/outerloop_odo_website_for_pr_preview branch from 8b5f479 to 93aa8bc Compare June 6, 2023 15:29
@odo-robot
Copy link

odo-robot bot commented Jun 6, 2023

NoCluster Tests on commit 128436b finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jun 6, 2023

OpenShift Unauthenticated Tests on commit 128436b finished successfully.
View logs: TXT HTML

@rm3l rm3l force-pushed the devtools_weeks/062023/outerloop_odo_website_for_pr_preview branch from 93aa8bc to 5a4a4e5 Compare June 6, 2023 15:37
@odo-robot
Copy link

odo-robot bot commented Jun 6, 2023

Unit Tests on commit 128436b finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jun 6, 2023

Validate Tests on commit 128436b finished successfully.
View logs: TXT HTML

@rm3l rm3l force-pushed the devtools_weeks/062023/outerloop_odo_website_for_pr_preview branch 2 times, most recently from f35cbe4 to 5c31777 Compare June 6, 2023 15:55
@odo-robot
Copy link

odo-robot bot commented Jun 6, 2023

Kubernetes Tests on commit 128436b finished successfully.
View logs: TXT HTML

@rm3l rm3l force-pushed the devtools_weeks/062023/outerloop_odo_website_for_pr_preview branch from 5c31777 to c5d0a58 Compare June 6, 2023 16:04
@odo-robot
Copy link

odo-robot bot commented Jun 6, 2023

OpenShift Tests on commit 128436b finished with errors.
View logs: TXT HTML

@feloy feloy closed this Jun 7, 2023
@feloy feloy reopened this Jun 7, 2023
@rm3l rm3l force-pushed the devtools_weeks/062023/outerloop_odo_website_for_pr_preview branch from c5d0a58 to c93b139 Compare June 7, 2023 07:29
@rm3l rm3l changed the title [WIP] [Dogfooding] odo deploy for the website [WIP] [Dogfooding] Create website deploy previews for PRs using odo deploy Jun 7, 2023
@odo-robot
Copy link

odo-robot bot commented Jun 7, 2023

Windows Tests (OCP) on commit 128436b finished successfully.
View logs: TXT HTML

@rm3l rm3l force-pushed the devtools_weeks/062023/outerloop_odo_website_for_pr_preview branch 2 times, most recently from d1821b8 to 0fb165f Compare June 8, 2023 12:57
@rm3l rm3l added the area/testing Issues or PRs related to testing, Quality Assurance or Quality Engineering label Jun 8, 2023
@rm3l rm3l marked this pull request as ready for review June 8, 2023 13:26
@rm3l rm3l changed the title [WIP] [Dogfooding] Create website deploy previews for PRs using odo deploy [Dogfooding] Create website deploy previews for PRs using odo deploy Jun 8, 2023
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. label Jun 8, 2023
@openshift-ci openshift-ci bot requested review from feloy and kadel June 8, 2023 13:26
…bsite

The goal is to leverage this for creating PR deploy previews
in an automated way.
rm3l added 4 commits June 14, 2023 16:10
We are using a robot account on quay.io,
which requires specific permissions per repository name,
which cannot be dynamic in this case.

Since we are scoping everything per namespace, it should be fine.
@rm3l rm3l force-pushed the devtools_weeks/062023/outerloop_odo_website_for_pr_preview branch from 0fb165f to 0a3d2dc Compare June 14, 2023 14:12
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Jun 15, 2023
@rm3l rm3l added this to the v3.12.0 🚀 milestone Jun 15, 2023
@rm3l
Copy link
Member Author

rm3l commented Jun 15, 2023

 << Timeline

  [FAILED] registry_list_output.mdx
  Expected
      <string>: Â Â strings.Join({
      Â Â 	... // 106 identical bytes
      Â Â 	"                          VERSIONS\nnodejs-react  StagingRegistry",
      Â Â 	"         React is a free and open-source front-en...  2.0.2, 2.1",
      +Â 	".0, 2.2",
      Â Â 	".0\nnodejs-react  DefaultDevfileRegistry  React is a free and ope",
      Â Â 	"n-source front-en...  2.0.2, 2.1.0\n```\n",
      Â Â }, "")
      
  to be empty
  In [It] at: /go/odo_1/tests/documentation/command-reference/doc_command_reference_init_test.go:189 @ 06/14/23 14:49:39.337
------------------------------
Spawning '/go/bin/odo delete project odo-dev' from /tmp/1520707937
•••Spawning '/go/bin/odo delete namespace odo-dev' from /tmp/2435076495
•

Summarizing 1 Failure:
  [FAIL] doc command reference odo init Non Interactive Mode fetching devfile from a registry when setting up the registry [It] Fetch Devfile from any registry of the list [nocluster]
  /go/odo_1/tests/documentation/command-reference/doc_command_reference_init_test.go:189

Ran 16 of 16 Specs in 51.597 seconds
FAIL! -- 15 Passed | 1 Failed | 0 Pending | 0 Skipped
--- FAIL: TestDocCommandReferenceAutomation (51.62s)
FAIL

Reported in #6876

/override Kubernetes-Integration-Tests/Kubernetes-Docs-Integration-Tests

@openshift-ci
Copy link

openshift-ci bot commented Jun 15, 2023

@rm3l: Overrode contexts on behalf of rm3l: Kubernetes-Integration-Tests/Kubernetes-Docs-Integration-Tests

In response to this:

<< Timeline

 [FAILED] registry_list_output.mdx
 Expected
     <string>: Â Â strings.Join({
     Â Â 	... // 106 identical bytes
     Â Â 	"                          VERSIONS\nnodejs-react  StagingRegistry",
     Â Â 	"         React is a free and open-source front-en...  2.0.2, 2.1",
     +Â 	".0, 2.2",
     Â Â 	".0\nnodejs-react  DefaultDevfileRegistry  React is a free and ope",
     Â Â 	"n-source front-en...  2.0.2, 2.1.0\n```\n",
     Â Â }, "")
     
 to be empty
 In [It] at: /go/odo_1/tests/documentation/command-reference/doc_command_reference_init_test.go:189 @ 06/14/23 14:49:39.337
------------------------------
Spawning '/go/bin/odo delete project odo-dev' from /tmp/1520707937
•••Spawning '/go/bin/odo delete namespace odo-dev' from /tmp/2435076495
•

Summarizing 1 Failure:
 [FAIL] doc command reference odo init Non Interactive Mode fetching devfile from a registry when setting up the registry [It] Fetch Devfile from any registry of the list [nocluster]
 /go/odo_1/tests/documentation/command-reference/doc_command_reference_init_test.go:189

Ran 16 of 16 Specs in 51.597 seconds
FAIL! -- 15 Passed | 1 Failed | 0 Pending | 0 Skipped
--- FAIL: TestDocCommandReferenceAutomation (51.62s)
FAIL

Reported in #6876

/override Kubernetes-Integration-Tests/Kubernetes-Docs-Integration-Tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@rm3l
Copy link
Member Author

rm3l commented Jun 15, 2023

  [FAILED] Timed out after 420.001s.
  Expected
      <string>:   __
       /  \__     Developing using the "wowyom" Devfile
       \__/  \    Namespace: cmd-dev-test572nhi
       /  \__/    odo version: v3.11.0
       \__/
      
      ↪ Running on the cluster in Dev mode
       •  Waiting for Kubernetes resources  ...
       âš   0/3 nodes are available: 3 pod has unbound immediate PersistentVolumeClaims. preemption: 0/3 nodes are available: 3 Preemption is not helpful for scheduling.
       âš   Pod is Pending
       âš   0/3 nodes are available: 3 pod has unbound immediate PersistentVolumeClaims. preemption: 0/3 nodes are available: 3 Preemption is not helpful for scheduling.
       âš   AttachVolume.Attach failed for volume "pvc-b8a36807-f40e-46d4-afd2-0b6cead142c7" : timed out waiting for external-attacher of vpc.block.csi.ibm.io CSI driver to attach volume r010-572467ca-20c8-4427-afb0-4e3e823f9268
       âš   Unable to attach or mount volumes: unmounted volumes=[odo-projects], unattached volumes=[odo-projects odo-shared-data kube-api-access-8ddd6]: timed out waiting for the condition
       âš   AttachVolume.Attach failed for volume "pvc-b8a36807-f40e-46d4-afd2-0b6cead142c7" : timed out waiting for external-attacher of vpc.block.csi.ibm.io CSI driver to attach volume r010-572467ca-20c8-4427-afb0-4e3e823f9268
       âš   Unable to attach or mount volumes: unmounted volumes=[odo-projects], unattached volumes=[kube-api-access-8ddd6 odo-projects odo-shared-data]: timed out waiting for the condition
       âš   AttachVolume.Attach failed for volume "pvc-b8a36807-f40e-46d4-afd2-0b6cead142c7" : timed out waiting for external-attacher of vpc.block.csi.ibm.io CSI driver to attach volume r010-572467ca-20c8-4427-afb0-4e3e823f9268
      
  to contain substring
      <string>: [Ctrl+c] - Exit
  In [BeforeEach] at: /go/odo_1/tests/helper/helper_run.go:54 @ 06/14/23 14:49:51.081
------------------------------
•

Summarizing 1 Failure:
  [FAIL] odo dev command tests when a component is bootstrapped when odo dev is executed and Ephemeral is set to false [BeforeEach] when stopping odo dev normally should have deleted all resources before returning
  /go/odo_1/tests/helper/helper_run.go:54

Ran 501 of 950 Specs in 1645.979 seconds
FAIL! -- 500 Passed | 1 Failed | 0 Pending | 449 Skipped

Not related - issue reported in #6894

/override OpenShift-Integration-tests/OpenShift-Integration-tests

@openshift-ci
Copy link

openshift-ci bot commented Jun 15, 2023

@rm3l: Overrode contexts on behalf of rm3l: OpenShift-Integration-tests/OpenShift-Integration-tests

In response to this:

 [FAILED] Timed out after 420.001s.
 Expected
     <string>:   __
      /  \__     Developing using the "wowyom" Devfile
      \__/  \    Namespace: cmd-dev-test572nhi
      /  \__/    odo version: v3.11.0
      \__/
     
     ↪ Running on the cluster in Dev mode
      •  Waiting for Kubernetes resources  ...
      âš   0/3 nodes are available: 3 pod has unbound immediate PersistentVolumeClaims. preemption: 0/3 nodes are available: 3 Preemption is not helpful for scheduling.
      âš   Pod is Pending
      âš   0/3 nodes are available: 3 pod has unbound immediate PersistentVolumeClaims. preemption: 0/3 nodes are available: 3 Preemption is not helpful for scheduling.
      âš   AttachVolume.Attach failed for volume "pvc-b8a36807-f40e-46d4-afd2-0b6cead142c7" : timed out waiting for external-attacher of vpc.block.csi.ibm.io CSI driver to attach volume r010-572467ca-20c8-4427-afb0-4e3e823f9268
      âš   Unable to attach or mount volumes: unmounted volumes=[odo-projects], unattached volumes=[odo-projects odo-shared-data kube-api-access-8ddd6]: timed out waiting for the condition
      âš   AttachVolume.Attach failed for volume "pvc-b8a36807-f40e-46d4-afd2-0b6cead142c7" : timed out waiting for external-attacher of vpc.block.csi.ibm.io CSI driver to attach volume r010-572467ca-20c8-4427-afb0-4e3e823f9268
      âš   Unable to attach or mount volumes: unmounted volumes=[odo-projects], unattached volumes=[kube-api-access-8ddd6 odo-projects odo-shared-data]: timed out waiting for the condition
      âš   AttachVolume.Attach failed for volume "pvc-b8a36807-f40e-46d4-afd2-0b6cead142c7" : timed out waiting for external-attacher of vpc.block.csi.ibm.io CSI driver to attach volume r010-572467ca-20c8-4427-afb0-4e3e823f9268
     
 to contain substring
     <string>: [Ctrl+c] - Exit
 In [BeforeEach] at: /go/odo_1/tests/helper/helper_run.go:54 @ 06/14/23 14:49:51.081
------------------------------
•

Summarizing 1 Failure:
 [FAIL] odo dev command tests when a component is bootstrapped when odo dev is executed and Ephemeral is set to false [BeforeEach] when stopping odo dev normally should have deleted all resources before returning
 /go/odo_1/tests/helper/helper_run.go:54

Ran 501 of 950 Specs in 1645.979 seconds
FAIL! -- 500 Passed | 1 Failed | 0 Pending | 449 Skipped

Not related - issue reported in #6894

/override OpenShift-Integration-tests/OpenShift-Integration-tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@rm3l
Copy link
Member Author

rm3l commented Jun 15, 2023

/test odo-ocp4.13-lp-interop-images
/test odo-ocp4.14-lp-interop-images

@openshift-merge-robot openshift-merge-robot merged commit 803718a into redhat-developer:main Jun 15, 2023
@openshift-merge-robot openshift-merge-robot temporarily deployed to external June 15, 2023 13:58 — with GitHub Actions Inactive
@rm3l rm3l deleted the devtools_weeks/062023/outerloop_odo_website_for_pr_preview branch June 15, 2023 13:58
@rm3l rm3l mentioned this pull request Jun 16, 2023
3 tasks
@rm3l rm3l added the area/outerloop Issues or PRs related to outer-loop use cases label Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/outerloop Issues or PRs related to outer-loop use cases area/testing Issues or PRs related to testing, Quality Assurance or Quality Engineering lgtm Indicates that a PR is ready to be merged. Required by Prow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants