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

Nephio operator for focom to oran-provisioning requests #849

Merged
merged 29 commits into from
Feb 17, 2025

Conversation

dek5troza
Copy link
Contributor

@dek5troza dek5troza commented Feb 5, 2025


NOTE: All data under the /config directory is generated by the operator sdk so does not require a full review.


Very basic implementation of FOCOM operator, which reconciles FOCOM provisioning requests into oran provisioning requests. This PR contains very basic functionality based on the POCs explored earlier, and with the review, more functionality will be added if needed.

Reconciling FOCOM provisioning requests into oran provisioning requests, will look for correct TemplateInfo referenced in the request. Current validation only checks if the referenced TemplateInfo exists, with given name and version. Template parameters are not validated yet, it will be done in the future. Once the referenced template is validated, reconcile will proceed to find OCloudId referenced in the request and make sure it exists. From the OCloudId it will read the secret referenced in the OCloud.

In this early stage, secret contains kubeconfig for the OCloud cluster, which will be used to build client to interact with the remote cluster. Using this client reconciler will produce Oran provisioning requests on the remote cluster.

Later, this is planned to be changed to support REST-like interface on the remote cluster, rather then using kubeconfig. Secret in this phase should be endpoint and bearer token,

Project contains few test samples, using testenv, and there is usual e2e test from the operator-sdk that can validate operator deployment. This code is at the POC level, and needs more work to be production ready.

ORAN provisioning request CRD is located inside oran-provisioning-crd folder. Focom CRDS are generated by operator-sdk/kubebuilder from go structs in the api folder. Generated yaml files are located in config/crd/bases.

Current code does not cater for more then one-shot operations, and patching of ORAN provisioning requests is not supported yet. Validation of the TemplateInfo parameters is not implemented yet, potentially this can be done by validating webhook, making them immutable for a start.

Copy link

linux-foundation-easycla bot commented Feb 5, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link
Contributor

nephio-prow bot commented Feb 5, 2025

Hi @dek5troza. Thanks for your PR.

I'm waiting for a nephio-project member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@efiacor
Copy link
Collaborator

efiacor commented Feb 5, 2025

/ok-to-test

@efiacor efiacor requested review from kispaljr, vjayaramrh, dkosteck and JamesMcDermott and removed request for lapentad February 10, 2025 08:34
@@ -28,7 +26,7 @@ unit: test
.PHONY: test
test: ## Run unit tests (go test)
ifeq ($(CONTAINER_RUNNABLE), 0)
$(RUN_CONTAINER_COMMAND) docker.io/library/golang:${GO_VERSION}-alpine3.19 \
$(RUN_CONTAINER_COMMAND) docker.io/nephio/gotests:1885274380137664512 \
Copy link
Contributor

@vjayaramrh vjayaramrh Feb 13, 2025

Choose a reason for hiding this comment

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

What is the rationale not to use a generally available golang container image? Thanks

Copy link
Collaborator

Choose a reason for hiding this comment

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

Plan is to move the presubmits for here and porch to use this common image coming form the test-infra project.
https://github.com/nephio-project/test-infra/blob/main/images/gotests/Dockerfile

GIT_ROOT_DIR ?= $(dir $(lastword $(MAKEFILE_LIST)))
include $(GIT_ROOT_DIR)/detect-container-runtime.mk

# Install link at https://github.com/securego/gosec#install if not running inside a container
.PHONY: gosec
gosec: ## Inspect the source code for security problems by scanning the Go Abstract Syntax Tree
ifeq ($(CONTAINER_RUNNABLE), 0)
$(RUN_CONTAINER_COMMAND) docker.io/securego/gosec:${GOSEC_VER} ./...
$(RUN_CONTAINER_COMMAND) docker.io/nephio/gotests:1885274380137664512 gosec -fmt=html -out=gosec-results.html \
Copy link
Contributor

Choose a reason for hiding this comment

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

why not use the regular available gosec image? Thanks

Copy link
Collaborator

Choose a reason for hiding this comment

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

Plan is to move the presubmits for here and porch to use this common image coming form the test-infra project.
https://github.com/nephio-project/test-infra/blob/main/images/gotests/Dockerfile

Copy link
Contributor

Choose a reason for hiding this comment

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

@efiacor Appreciate the response,
From what I understand regarding container best practices, you want a container to contain only one application.

@arora-sagar
Copy link
Contributor

I am fine with this MR, I already tested it end-to-end with O2IMS operator. It works fine.

I am not a big fan of how it consumes the kubeconfig as a secret but that can be discussed later.

/approve

@vjayaramrh
Copy link
Contributor

I had a chance to look at the PR and got through the structure, was not able to test out the PR though. Looks good to me.

@vjayaramrh
Copy link
Contributor

/lgtm

@liamfallon
Copy link
Member

/approve
/lgtm

Copy link
Contributor

nephio-prow bot commented Feb 17, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: arora-sagar, liamfallon

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 Feb 17, 2025
@nephio-prow nephio-prow bot merged commit 2e13897 into nephio-project:main Feb 17, 2025
12 checks passed
@efiacor efiacor deleted the nephio-focom-operator branch February 17, 2025 22:45
nephio-prow bot pushed a commit that referenced this pull request Feb 18, 2025
Prow docker build job for the following -
#849
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[focom] Create FOCOM operator
5 participants