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

Rework GCE sandbox setup and e2e execution #56

Merged
merged 35 commits into from
May 31, 2023

Conversation

johnbelamaric
Copy link
Member

No description provided.

@johnbelamaric
Copy link
Member Author

/hold

Not ready yet.

@johnbelamaric
Copy link
Member Author

FYI, here is how I launch this to test it (you can get rid of the delete in the beginning the first time you run it...):

$ gcloud compute instances delete -q nephio-r1-e2e && \
  gcloud compute instances create \
                 --machine-type e2-standard-8 \
                 --boot-disk-size 200GB \
                 --image-family=ubuntu-2204-lts \
                 --image-project=ubuntu-os-cloud \
                 --metadata=startup-script-url=https://raw.githubusercontent.com/johnbelamaric/nephio-test-infra/update-packages/e2e/provision/gce_init.sh,nephio-setup-debug=true,nephio-test-infra-repo=https://github.com/johnbelamaric/nephio-test-infra.git,nephio-test-infra-branch=update-packages \
                 nephio-r1-e2e && \
  sleep 30 && \
  gcloud compute ssh nephio-r1-e2e -- \
                     -o ProxyCommand='corp-ssh-helper %h %p' \
                     sudo journalctl -u google-startup-scripts.service --follow

@johnbelamaric
Copy link
Member Author

johnbelamaric commented May 27, 2023

Issues - some fixed / worked around, some not yet:

Follow up items:

  • Do not use any dashes (-) in your cluster package names when you clone nephio-workload-cluster, it makes it really ugly (we'll need to fix this).
  • I want to add the Backstage kubernetes plugin to our UI, at least for the mgmt cluster (but maybe for all clusters)
  • Sometimes the package names don't end up correct, I think this is due to the abuse of package context we are doing, we will need to fix that (Porch: PackageVariant Redux kptdev/kpt#3973)
  • Sometimes bootrapper fails with a message like below - I actually that has the same root cause as the package name issue:
    I0528 23:45:00.695325 1 reconciler.go:132] "msg"="clusterName not found" "PackageRevision"={"name":"mgmt-staging-12477d7ed11947b6e943ff0c3a38547525104761","namespace":"default"} "annotations"={"config.kubernetes.io/index":"0","internal.config.kubernetes.io/index":"0","internal.config.kubernetes.io/path":"rootsync.yaml","internal.kpt.dev/upstream-identifier":"configsync.gke.io|RootSync|config-management-system|example-cluster-name"} "controller"="BootstrapPackageController" "controllerGroup"="porch.kpt.dev" "controllerKind"="PackageRevision" "name"="mgmt-staging-12477d7ed11947b6e943ff0c3a38547525104761" "namespace"="default" "reconcileID"="7765e4b0-bd4f-43c5-9578-5da97074e68e" "resource"="configsync.gke.io/v1beta1.RootSync.example-cluster-name"
  • We should include a stock "org" catalog and maybe team catalogs or something too in the sandbox.
  • mgmt-staging shows up in the UI as a "team blueprint" directory because it is not a deployment repo and that's the default spot for those. Where should it go? Should we mark it read only (which actually is just a UI thing)?

Comment on lines 83 to 96
# I don't know how to make ansible do what I want, this is what I want
mkdir /tmp/mgmt-repo
/usr/local/bin/kpt pkg get --for-deployment https://github.com/nephio-project/nephio-example-packages.git/repository@repository/v2 /tmp/mgmt-repo/mgmt
# sudo because docker
sudo /usr/local/bin/kpt fn render /tmp/mgmt-repo/mgmt
/usr/local/bin/kpt live init /tmp/mgmt-repo/mgmt
/usr/local/bin/kpt live apply /tmp/mgmt-repo/mgmt

mkdir /tmp/mgmt-rootsync
/usr/local/bin/kpt pkg get --for-deployment https://github.com/nephio-project/nephio-example-packages.git/rootsync@rootsync/v2 /tmp/mgmt-rootsync/mgmt
# sudo because docker
sudo /usr/local/bin/kpt fn render /tmp/mgmt-rootsync/mgmt
/usr/local/bin/kpt live init /tmp/mgmt-rootsync/mgmt
/usr/local/bin/kpt live apply /tmp/mgmt-rootsync/mgmt
Copy link
Member

Choose a reason for hiding this comment

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

Those instructions seems to belong to the workload process, right?

So if that's the case the can be included as a pre_task here

    - role: kpt
      repo_uri: https://github.com/nephio-project/nephio-example-packages
      local_dest_directory: /tmp/mgmt-repo/mgmt
      pkg: repository
      version: repository/v2
      context: kind-kind
      namespaces:
        - default

That role will execute the following instructions on the package:

  • creates the base folder if doesn't exists (`/tmp/mgmt-repo/mgmt)
  • kpt pkg get (If it hasn't done)
  • kpt pkg tree
  • kpt fn render
  • kpt pkg diff
  • kpt live init
  • kpt live apply (5 attempts)

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks, I tried that but it didn't work exactly like I wanted:

  1. We probably need to update that to use --for-deployment
  2. I need the package name to be "mgmt", so I need the actual kpt command that runs to be the one in the script - I think it did something a little different, I ended up with /tmp/mgmt-repo/mgmt/repository instead of /tmp/mgmt-repo/mgmt. The idea is that we rename the package during the "get" - that rename actually is meaningful, it triggers some automation.

## Licensed under the Apache License 2.0
## SPDX-License-Identifier: Apache-2.0
---
- name: systctl config
Copy link
Member

Choose a reason for hiding this comment

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

It seems like there is an ansible module for managing sysctl entries, so manybe this can be implemented like

- name: Set kernel parameters
  ansible.posix.sysctl:
    name: {{ item.name }}"
    value: "{{ item.value }}"
    state: present
  loop:
    - {name: fs.inotify.max_user_watches, value: 524288}
    - {name: fs.inotify.max_user_instances, value:512}
    - {name: kernel.keys.maxkeys, value:500000 }
    - {name: kernel.keys.maxbytes, value:1000000}

Comment on lines 15 to 17
- {pkg: porch-dev, version: porch-dev/v1, namespaces: [porch-fn-system, porch-system]}
- {pkg: nephio-controllers, version: nephio-controllers/v1, namespaces: [nephio-system]}
- {pkg: configsync, version: configsync/v1, namespaces: [config-management-monitoring, config-management-system, resource-group-system]}
Copy link
Member

Choose a reason for hiding this comment

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

I was planning to extract some of this values as configurable parameters. I did some of that work in this PR, more likely for R1+

Copy link
Member Author

Choose a reason for hiding this comment

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

ok. I want to split out the "base install" vs the "sandbox install". I think it's close now but now quite there.

- Adds MetalLB base installation to management cluster
- Adds Sandbox config for Metal LB to management cluster
- Adds updated Gitea installation package with LB service
- Adds Gitea secret in nephio-system namespace
@johnbelamaric
Copy link
Member Author

johnbelamaric commented May 31, 2023

/hold cancel

Ok, I think this is ready to merge. The comment above does include some additional follow up items. But those should become separate issues.

Note that there is definitely flakiness. Some clusters may not fully come up or all the packages may not all auto approve. These are issues with the underlying subsystems that we need to fix, but they shouldn't hold up this PR.

You can test this by following the README, except that you have to use this PR as the startup-script-url, as described in #56 (comment).

@electrocucaracha
Copy link
Member

/approve

This will need some changes in Vagrantfile as well, but it can be modified later.

@electrocucaracha
Copy link
Member

/lgtm

@henderiw
Copy link
Collaborator

I was able to install using this method. A few things to consider.

  • I had to add the ubuntu user to the docker group
  • the Kubectl autocompletion was not fully working for me
  • I had to copy the kubeconfig from kind to ~/.kube/config.

@vjayaramrh you asked for things to check once this is completed. Here are some commands I run.

ubuntu@nephio-r1-e2e:$ k get repositories.infra.nephio.org
NAME REPO_STATUS
mgmt True
mgmt-staging True
ubuntu@nephio-r1-e2e:
$ k get repositories.infra.nephio.org -A
NAMESPACE NAME REPO_STATUS
default mgmt True
default mgmt-staging True
ubuntu@nephio-r1-e2e:$ k get repositories.infra.nephio.org -A^C
ubuntu@nephio-r1-e2e:
$ k get tokens.infra.nephio.org -A
NAMESPACE NAME REPO_TOKEN_STATUS
config-management-system mgmt-access-token-configsync True
config-management-system mgmt-staging-access-token-configsync True
default mgmt-access-token-porch True
default mgmt-staging-access-token-porch True
ubuntu@nephio-r1-e2e:$
ubuntu@nephio-r1-e2e:
$
ubuntu@nephio-r1-e2e:$
ubuntu@nephio-r1-e2e:
$
ubuntu@nephio-r1-e2e:$
ubuntu@nephio-r1-e2e:
$
ubuntu@nephio-r1-e2e:$ k get con
configmanagements.configmanagement.gke.io configmaps controllerrevisions.apps
ubuntu@nephio-r1-e2e:
$ k get con
configmanagements.configmanagement.gke.io configmaps controllerrevisions.apps
ubuntu@nephio-r1-e2e:$ k get rootsyncs.configsync.gke.io -A
NAMESPACE NAME RENDERINGCOMMIT RENDERINGERRORCOUNT SOURCECOMMIT SOURCEERRORCOUNT SYNCCOMMIT SYNCERRORCOUNT
config-management-system mgmt 2779c79bc63de3a87e2d92e3bac07bd0f1fb97c8 2779c79bc63de3a87e2d92e3bac07bd0f1fb97c8 2779c79bc63de3a87e2d92e3bac07bd0f1fb97c8
ubuntu@nephio-r1-e2e:
$
ubuntu@nephio-r1-e2e:$
ubuntu@nephio-r1-e2e:
$ k get rootsyncs.configsync.gke.io -A
NAMESPACE NAME RENDERINGCOMMIT RENDERINGERRORCOUNT SOURCECOMMIT SOURCEERRORCOUNT SYNCCOMMIT SYNCERRORCOUNT
config-management-system mgmt 2779c79bc63de3a87e2d92e3bac07bd0f1fb97c8 2779c79bc63de3a87e2d92e3bac07bd0f1fb97c8 2779c79bc63de3a87e2d92e3bac07bd0f1fb97c8
ubuntu@nephio-r1-e2e:$
ubuntu@nephio-r1-e2e:
$
ubuntu@nephio-r1-e2e:$
ubuntu@nephio-r1-e2e:
$
ubuntu@nephio-r1-e2e:$
ubuntu@nephio-r1-e2e:
$
ubuntu@nephio-r1-e2e:$
ubuntu@nephio-r1-e2e:
$ k get repositories.
repositories.config.porch.kpt.dev repositories.infra.nephio.org
ubuntu@nephio-r1-e2e:$ k get repositories.
repositories.config.porch.kpt.dev repositories.infra.nephio.org
ubuntu@nephio-r1-e2e:
$ k get repositories.config.porch.kpt.dev -A
NAMESPACE NAME TYPE CONTENT DEPLOYMENT READY ADDRESS
default free5gc-packages git Package false True https://github.com/nephio-project/free5gc-packages.git
default mgmt git Package true True http://172.18.0.200:3000/nephio/mgmt.git
default mgmt-staging git Package false True http://172.18.0.200:3000/nephio/mgmt-staging.git
default nephio-example-packages git Package false True https://github.com/nephio-project/nephio-example-packages.git
ubuntu@nephio-r1-e2e:$
ubuntu@nephio-r1-e2e:
$
ubuntu@nephio-r1-e2e:$
ubuntu@nephio-r1-e2e:
$
ubuntu@nephio-r1-e2e:$
ubuntu@nephio-r1-e2e:
$ k get packagerevisions.porch.kpt.dev
NAME PACKAGE WORKSPACENAME REVISION LATEST LIFECYCLE REPOSITORY
free5gc-packages-148a8446856cfcba9ba53f9c5786bacb835f3733 free5gc-cp main main false Published free5gc-packages
free5gc-packages-daba5a241a23af3ce777b256c39dcedc3c5e3917 free5gc-cp v1 v1 true Published free5gc-packages
free5gc-packages-0173ec955eeb21c2bebdf53699d969295bbd17a6 free5gc-operator main main false Published free5gc-packages
free5gc-packages-9f723b4dd4dd0d1078da499ab71f11f54b6f4bea free5gc-operator v1 v1 false Published free5gc-packages
free5gc-packages-f35f8ec1501f4c19e2f062e24700c17ba0ec4b7e free5gc-operator v2 v2 true Published free5gc-packages
free5gc-packages-6bfa8dccd0f0cbc2a2ecbc7c23f57992347a63aa free5gc-upf main main false Published free5gc-packages
free5gc-packages-bc41f4d0a9f984b7a7aa8ef6623a615e2aa75993 free5gc-upf v1 v1 true Published free5gc-packages
free5gc-packages-48d8a5f97319565d419a37966ce6068cc4925864 pkg-example-amf-bp main main false Published free5gc-packages
free5gc-packages-616794624322247318a7b3a707d75f1122518de1 pkg-example-amf-bp v1 v1 false Published free5gc-packages
free5gc-packages-cee4c95162d845ad0f957fdad1d56ebc15bc7c9f pkg-example-amf-bp v2 v2 true Published free5gc-packages
free5gc-packages-71893fab44f53e3677dc6626a83acf0b2bc26a65 pkg-example-smf-bp main main false Published free5gc-packages
free5gc-packages-1759ef4fc3ee273e2bcce0ddfdb13644d48d406d pkg-example-smf-bp v1 v1 false Published free5gc-packages
free5gc-packages-1348875a05a60c9869f34717ac7695eb47b8e82b pkg-example-smf-bp v2 v2 true Published free5gc-packages
free5gc-packages-3228665cf1cd862775af48cbafa7218b9f228533 pkg-example-upf-bp main main false Published free5gc-packages
free5gc-packages-b3fa4014576907d7a7da61d5159798464168b80f pkg-example-upf-bp v1 v1 false Published free5gc-packages
free5gc-packages-7d16116c4fce959fd01ef8787f186c81d343fd42 pkg-example-upf-bp v2 v2 true Published free5gc-packages
nephio-example-packages-7a205bec491553b3071f42fb26b90db95b771bd3 5g-core-topology main main false Published nephio-example-packages
nephio-example-packages-ed4b7dc97a48214b47f189fb6c032ef6cdadf350 5g-core-topology v1 v1 false Published nephio-example-packages
nephio-example-packages-ae679b5ac4fbb7719e7302fe6726e26005b004e0 5g-core-topology v2 v2 true Published nephio-example-packages
nephio-example-packages-39d014386879b8bf38dcc16f504b9bebda918481 cert-manager main main false Published nephio-example-packages
nephio-example-packages-4823ff95d9c018c55f53fbc7f24c8ae77c90f3f3 cert-manager v1 v1 false Published nephio-example-packages
nephio-example-packages-5d6969cb98e4d6494ff6eadd6c52e94368f8261c cert-manager v2 v2 true Published nephio-example-packages
nephio-example-packages-b00358ba2a15a0a69df1a170f17c1a21158fce08 cluster-capi main main false Published nephio-example-packages
nephio-example-packages-a8e7abf1c2c08edcfef2b2ed416fa1b8e3be8d73 cluster-capi v1 v1 false Published nephio-example-packages
nephio-example-packages-507a12b04cd10dc93ee0108d4784fc204bd5022f cluster-capi v2 v2 false Published nephio-example-packages
nephio-example-packages-e6a0e7ab29a5aad14978559241bd1f47a9f3e3bb cluster-capi v3 v3 false Published nephio-example-packages
nephio-example-packages-2144369250410c527ac4716b50fce8c88656f231 cluster-capi v4 v4 true Published nephio-example-packages
nephio-example-packages-cf796e1183915bedb82d6deaef33034fc10ba2f7 cluster-capi-infrastructure-docker main main false Published nephio-example-packages
nephio-example-packages-6be85e6942a3f9a2e2e4d6e6b9a4c95172142c8e cluster-capi-infrastructure-docker v1 v1 true Published nephio-example-packages
nephio-example-packages-f3ab70e98daff9d4be891f5b1fe052ddb4fc451d cluster-capi-kind main main false Published nephio-example-packages
nephio-example-packages-89e4b1465c522c9aa81b58ed1a47ad2574532021 cluster-capi-kind v1 v1 false Published nephio-example-packages
nephio-example-packages-06e8ef4006208de32da20d60c9a5b78ede91a367 cluster-capi-kind v2 v2 false Published nephio-example-packages
nephio-example-packages-878cdef1bf31933b020f30f6ae2459683194b3a8 cluster-capi-kind v3 v3 true Published nephio-example-packages
nephio-example-packages-66dad0de8e2d136b26ab5fb2fc7fc38600dd20d5 cluster-capi-kind-docker-templates main main false Published nephio-example-packages
nephio-example-packages-4204d1ed31d71ac2147a4bd7dad614bf3ab0dd50 cluster-capi-kind-docker-templates v1 v1 true Published nephio-example-packages
nephio-example-packages-13714815da4da1f378698d6daa650c3799fdbd9c configsync main main false Published nephio-example-packages
nephio-example-packages-73a2b11f81e580686fc01773809b4050958177e3 configsync v1 v1 true Published nephio-example-packages
nephio-example-packages-84319b4988873979cccb1a3a68ca6331277b5ac3 free5gc-smf-org-example main main false Published nephio-example-packages
nephio-example-packages-391457ef8cae687ae9c7dfac8114ee9ad00a0f6a free5gc-smf-org-example v1 v1 false Published nephio-example-packages
nephio-example-packages-12b4164a8aed5ffc6e197b8af97edb34b31a11bf free5gc-smf-org-example v2 v2 true Published nephio-example-packages
nephio-example-packages-d3916bb97b3aa86e030a62d0931155904b0bc143 gitea main main false Published nephio-example-packages
nephio-example-packages-066866a075556b659f0837febece740c9bd25925 gitea v1 v1 false Published nephio-example-packages
nephio-example-packages-6dbdc674df9a117fa1a708ac5a6be22579f8a2f6 gitea v2 v2 false Published nephio-example-packages
nephio-example-packages-e3f5dce5fc98f9c06c32fa0342f9b0ae78eca562 gitea v3 v3 true Published nephio-example-packages
nephio-example-packages-d2e509c22a794ea80ad3264497d3a05030e57f97 kindnet main main false Published nephio-example-packages
nephio-example-packages-073f3256d9ba4c32a3cf491c1cb9ee683b14b5c0 kindnet v1 v1 true Published nephio-example-packages
nephio-example-packages-0c7267c7f77b6eca6a721b281c5f68f407af8a1b metallb main main false Published nephio-example-packages
nephio-example-packages-14dcd072fa92334197a1f23af02d9a4b55e8bae5 metallb v1 v1 true Published nephio-example-packages
nephio-example-packages-c96e3a771f14d3ee8bcd027d265ab77cd0154176 metallb-sandbox-config main main false Published nephio-example-packages
nephio-example-packages-a48da09e5a4d99fae4ad5f54261e53ef1ee98b25 metallb-sandbox-config v1 v1 true Published nephio-example-packages
nephio-example-packages-9cfca1f2068f57f345eff898ab0973877f6bc0f4 nephio-controllers main main false Published nephio-example-packages
nephio-example-packages-f14d53cac135f0b726bb2e92ad68ec51700e0b1b nephio-controllers v1 v1 false Published nephio-example-packages
nephio-example-packages-6c533321750df3e3771efdeb33bb401254d5c65e nephio-controllers v2 v2 false Published nephio-example-packages
nephio-example-packages-df595770345d152d1276a8500443a14d75bf46f5 nephio-controllers v3 v3 true Published nephio-example-packages
nephio-example-packages-dcb8e61d795192f5dc01445f8d3cbacd5cdebfd2 nephio-controllers/app main main false Published nephio-example-packages
nephio-example-packages-104b2681f7296c81d21a68dfff74c4c352ce87aa nephio-controllers/crd main main false Published nephio-example-packages
nephio-example-packages-fb91831be54e909c6fb7f05598a009bf45efd662 nephio-stock-repos main main false Published nephio-example-packages
nephio-example-packages-aa903df4b3652fdb5fdec2fd599b5b6275397b28 nephio-stock-repos v1 v1 true Published nephio-example-packages
nephio-example-packages-05707c7acfb59988daaefd85e3f5c299504c2da1 nephio-workload-cluster main main false Published nephio-example-packages
nephio-example-packages-781e1c17d63eed5634db7b93307e1dad75a92bce nephio-workload-cluster v1 v1 false Published nephio-example-packages
nephio-example-packages-5929727104f2c62a2cb7ad805dabd95d92bf727e nephio-workload-cluster v2 v2 false Published nephio-example-packages
nephio-example-packages-cdc6d453ae3e1bd0b64234d51d575e4a30980a77 nephio-workload-cluster v3 v3 false Published nephio-example-packages
nephio-example-packages-c78ecc6bedc8bf68185f28a998718eed8432dc3b nephio-workload-cluster v4 v4 false Published nephio-example-packages
nephio-example-packages-46b923a6bbd09c2ab7aa86c9853a96cbd38d1ed7 nephio-workload-cluster v5 v5 true Published nephio-example-packages
nephio-example-packages-b7c7e699b59c8d4a1760aea48ce132a0593306dc porch-dev main main false Published nephio-example-packages
nephio-example-packages-b0bfe65d2d3c1f446baff1c43f6add440b815a7b porch-dev v1 v1 true Published nephio-example-packages
nephio-example-packages-68d6966f32aa66449fde07a1dd9467868c7d7264 repository main main false Published nephio-example-packages
nephio-example-packages-a1857c4a59de1befe23887262bf404f4dc09c8f8 repository v1 v1 false Published nephio-example-packages
nephio-example-packages-cc145a196a80f2f0fbe84f2696845f4fe541a6dc repository v2 v2 true Published nephio-example-packages
nephio-example-packages-0f2d3addc6d3c8f459d57c37052ae00ff36756ad resource-backend main main false Published nephio-example-packages
nephio-example-packages-21239ec8f77c8b16d99ded98ce2420e6065d9a32 resource-backend v1 v1 true Published nephio-example-packages
nephio-example-packages-6791c8a4ec361a541fdcb47382c3d6d00fcfb03d resource-backend/app main main false Published nephio-example-packages
nephio-example-packages-c3f4383677a5308fdad968b6221e19bac8259323 resource-backend/crd main main false Published nephio-example-packages
nephio-example-packages-35c042505593420e4baff45f584a90ebfaf49ed6 rootsync main main false Published nephio-example-packages
nephio-example-packages-4ae4c452ace5bec1fe782efea3c8bd633405ffdd rootsync v1 v1 false Published nephio-example-packages
nephio-example-packages-023faf16f3d920f30fc3155e7700e02d16189f97 rootsync v2 v2 true Published nephio-example-packages
nephio-example-packages-0a456e012b209a1609ca72fa4c2b0ca6ce97f7f2 ueransim main main false Published nephio-example-packages
nephio-example-packages-fb6e4adecc13c50da838953ece623cf04de21884 ueransim v1 v1 true Published nephio-example-packages

@henderiw
Copy link
Collaborator

/approve
/lgtm

@radoslawc
Copy link
Collaborator

/approve

@nephio-prow
Copy link
Contributor

nephio-prow bot commented May 31, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: electrocucaracha, henderiw, johnbelamaric, radoslawc, vjayaramrh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@nephio-prow nephio-prow bot added the approved label May 31, 2023
@nephio-prow nephio-prow bot merged commit 590029b into nephio-project:main May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants