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

Add EP template and first EP #4

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/build-bundle-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy Bundle Images to GHCR
env:
DOTNET_VERSION: '6.0.x'
on:
push:
branches:
- master
workflow_dispatch:
jobs:
push-bundle-image:
runs-on: ubuntu-latest
defaults:
run:
working-directory: '.'
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@main

- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: 'Build Bundle Image'
run: |
make bundle
make bundle-build
make bundle-push

30 changes: 30 additions & 0 deletions .github/workflows/build-operator-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy Operator Images to GHCR
env:
DOTNET_VERSION: '6.0.x'
on:
push:
branches:
- master
workflow_dispatch:
jobs:
push-operator-image:
runs-on: ubuntu-latest
defaults:
run:
working-directory: '.'
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@main

- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: 'Build Operator Image'
run: |
make docker-build
make docker-push

1 change: 1 addition & 0 deletions .gopath/src/github.com/k8snetworkplumbingwg/ptp-operator
1 change: 1 addition & 0 deletions COMMUNITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
COMMUNITY.md
35 changes: 35 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Tracking
## Bugs
Bugs should all be tracked through github issues in the ptp-operator repo. Issues should not be raised in the linuxptp-daemon repo, except where for repo-specific things (e.g. issues with image builds in the repo). This is in order to allow all project bugs to be tracked together
## Features
Features should be tracked through github issues in the ptp-operator repo.

# Submissions
## Submission expectations:
Contributors are responsible for ensuring the following with their submissions:
- Contributors are responsible for only adding code that they wrote, or is licensed appropriately. No GPL code should be imported.
- Code is tested adequately
- See https://github.com/k8snetworkplumbingwg/ptp-operator/blob/master/TESTING.md for more details on expectations of testing prior to submission
- Code introduces sufficient new test coverage
- See https://github.com/k8snetworkplumbingwg/ptp-operator/blob/master/TESTING.md for more details on expectations of added test coverage
- We expect that each tracked issue (feature or bug) will be a single complete submission per repo(daemon and operator), rather than several partial/incomplete submissions, unless not possible for technical reasons
- all tracking under ptp-operator repo
- Commit messages will adequately describe what’s being done
- Title: summarize the code change
- Title: include the bug ticket #, but not a copy of bug title (bug title can be included in the description)
- Description: explain the Root Cause and Solution
- PR is linked to a github issue under the ptp-operator repo
- PR will follow best practices, be well written, and adequately commented.
## Review expectations
Maintainers are responsible for ensuring that adequate review is conducted. This includes the following:
- PR is aligned with the design plan of the project
- Issues should be rejected if going against maintainer design intent
- PR adequately addresses the issue it’s intended to fix
- PR code follows best practices
- PR does not break anything
- PR does not introduce any security issues
- PR does not introduce any potential performance issues
Testing by submitter is adequate
- PR adds necessary test coverage
- PR commit message is descriptive of what’s being done
- PR is not introducing proprietary code, except in plugin section
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.22-openshift-4.18 AS builder
WORKDIR /go/src/github.com/openshift/ptp-operator
FROM golang:1.22.4 AS builder
WORKDIR /go/src/github.com/k8snetworkplumbingwg/ptp-operator
COPY . .
ENV GO111MODULE=off
RUN make

FROM registry.ci.openshift.org/ocp/4.18:base-rhel9
COPY --from=builder /go/src/github.com/openshift/ptp-operator/build/_output/bin/ptp-operator /usr/local/bin/
COPY --from=builder /go/src/github.com/openshift/ptp-operator/manifests /manifests
FROM quay.io/centos/centos:stream9
COPY --from=builder /go/src/github.com/k8snetworkplumbingwg/ptp-operator/build/_output/bin/ptp-operator /usr/local/bin/
COPY --from=builder /go/src/github.com/k8snetworkplumbingwg/ptp-operator/manifests /manifests
COPY bindata /bindata

LABEL io.k8s.display-name="OpenShift ptp-operator" \
io.k8s.description="This is a component that manages cluster PTP configuration." \
io.openshift.tags="openshift,ptp" \
com.redhat.delivery.appregistry=true \
maintainer="PTP Dev Team <ptp[email protected]>"
maintainer="Multus Team <multus[email protected]>"
Copy link
Collaborator

Choose a reason for hiding this comment

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

should be
maintainer="PTP Dev Team [email protected]"


ENTRYPOINT ["/usr/local/bin/ptp-operator"]
ENTRYPOINT ["/usr/local/bin/ptp-operator"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

return char

6 changes: 3 additions & 3 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.22-openshift-4.18 AS builder
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure if we are running ci using rhel images or now . Any comment on this ? Do we have CI integrated for upstream now

WORKDIR /go/src/github.com/openshift/ptp-operator
WORKDIR /go/src/github.com/k8snetworkplumbingwg/ptp-operator
COPY . .
ENV GO111MODULE=off
RUN make

FROM registry.ci.openshift.org/ocp/4.18:base-rhel9
COPY --from=builder /go/src/github.com/openshift/ptp-operator/build/_output/bin/ptp-operator /usr/local/bin/
COPY --from=builder /go/src/github.com/openshift/ptp-operator/manifests /manifests
COPY --from=builder /go/src/github.com/k8snetworkplumbingwg/ptp-operator/build/_output/bin/ptp-operator /usr/local/bin/
COPY --from=builder /go/src/github.com/k8snetworkplumbingwg/ptp-operator/manifests /manifests
COPY bindata /bindata

LABEL io.k8s.display-name="OpenShift ptp-operator" \
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
#
# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
# openshift.io/ptp-operator-bundle:$VERSION and openshift.io/ptp-operator-catalog:$VERSION.
IMAGE_TAG_BASE ?= openshift.io/ptp-operator
IMAGE_TAG_BASE ?= ghcr.io/k8snetworkplumbingwg/ptp-operator

# BUNDLE_IMG defines the image:tag used for the bundle.
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
Expand All @@ -43,7 +43,7 @@ BUNDLE_GEN_FLAGS ?= -q --overwrite --version $(VERSION).0 $(BUNDLE_METADATA_OPTS
OPERATOR_SDK_VERSION ?= v1.22.0-ocp

# Image URL to use all building/pushing image targets
IMG ?= quay.io/openshift/origin-ptp-operator:$(VERSION)
IMG ?= ghcr.io/k8snetworkplumbingwg/ptp-operator:latest

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down
4 changes: 2 additions & 2 deletions OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ reviewers:
- SchSeba
- fedepaol
- oribon
- josephdrichard
- k8snetworkplumbingwg
Copy link
Collaborator

Choose a reason for hiding this comment

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

also why joseph removed?

- aneeshkp
- nishant-parekh
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can remove everyone that are not valid here

- jzding
Expand All @@ -24,7 +24,7 @@ approvers:
- SchSeba
- fedepaol
- oribon
- josephdrichard
- k8snetworkplumbingwg
Copy link
Collaborator

Choose a reason for hiding this comment

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

also why joseph removed?

- aneeshkp
- nishant-parekh
- jzding
Expand Down
8 changes: 4 additions & 4 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
projectName: ptp-operator
repo: github.com/openshift/ptp-operator
repo: github.com/k8snetworkplumbingwg/ptp-operator
resources:
- api:
crdVersion: v1
Expand All @@ -14,7 +14,7 @@ resources:
domain: openshift.io
group: ptp
kind: PtpConfig
path: github.com/openshift/ptp-operator/api/v1
path: github.com/k8snetworkplumbingwg/ptp-operator/api/v1
version: v1
webhooks:
validation: true
Expand All @@ -25,7 +25,7 @@ resources:
domain: openshift.io
group: ptp
kind: NodePtpDevice
path: github.com/openshift/ptp-operator/api/v1
path: github.com/k8snetworkplumbingwg/ptp-operator/api/v1
version: v1
- api:
crdVersion: v1
Expand All @@ -34,7 +34,7 @@ resources:
domain: openshift.io
group: ptp
kind: PtpOperatorConfig
path: github.com/openshift/ptp-operator/api/v1
path: github.com/k8snetworkplumbingwg/ptp-operator/api/v1
version: v1
webhooks:
validation: true
Expand Down
16 changes: 16 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Unit Testing
## Validation
Very simple suite of tests to make sure the operator can deploy. Normally no changes will be required here.
## Conformance
This testing is at a very high level, to ensure that given functionality is broken. An example of this would be to test enabling the a reference plugin, and then test that the daemon has the expected logs from the reference plugin

# End-to-End testing
More in-depth testing to ensure the operator is functioning correctly, and ptp is actually running correctly on the cluster after deployment

# Feature development expectations
## Validation
Normally no changes are required here. Unless developing a new container for example.
## Conformance
Expected developers of any new features will add new conformance tests as part of submission
## End-to-End
New e2e tests should be added to do more in-depth testing for new features. At least basic tests should be added before submitting feature, and should ensure plan is in place for more tests if required.
6 changes: 3 additions & 3 deletions Dockerfile.ocp → addons/redhat/Dockerfile.ocp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.22-openshift-4.18 AS builder
WORKDIR /go/src/github.com/openshift/ptp-operator
WORKDIR /go/src/github.com/k8snetworkplumbingwg/ptp-operator
Copy link
Collaborator

Choose a reason for hiding this comment

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

o we need ocp dockerfile upstream ?

COPY . .
ENV GO111MODULE=off
RUN make

FROM registry.ci.openshift.org/ocp/4.18:base-rhel9
COPY --from=builder /go/src/github.com/openshift/ptp-operator/build/_output/bin/ptp-operator /usr/local/bin/
COPY --from=builder /go/src/github.com/openshift/ptp-operator/manifests /manifests
COPY --from=builder /go/src/github.com/k8snetworkplumbingwg/ptp-operator/build/_output/bin/ptp-operator /usr/local/bin/
COPY --from=builder /go/src/github.com/k8snetworkplumbingwg/ptp-operator/manifests /manifests
COPY bindata /bindata

LABEL io.k8s.display-name="OpenShift ptp-operator" \
Expand Down
30 changes: 30 additions & 0 deletions addons/redhat/QUALITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Regression testing
Regressions will be run periodically by QE, in order to ensure that everything is functional. This should be done before every release, including new builds of previous releases. Nothing should be delivered to customers that QE hasn't run a regression on and signed off on.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Who is upstream QE here ? our upstream CI should be configured to run regression ., I don't think QE will be running any regression on upstream


# Feature Testing
## Red Hat requirements
Red Had developers will do initial validation as part of delivery. Red Hat QE will do verification to ensure everything works correctly, before delivering to customer.
## External contributor features
They are responsible for testing. Test strategy should be reviewed before it is merged.

# Bug fixing
## Upstream Bugs
In order to maintain a high level of quality upstream, Red Hat developers will make a point of fixing any bugs raised in upstream PTP project. While priority may be given based on business requirements, as maintainers of the upstream PTP project, Red Hat developers will eventually fix all legitimate upstream bugs, regardless of who raises it. However, other partners and contributors to the upstream project will be strongly encouraged to fix bugs too, especially those that they raise or are primarily impacted by.
## Customer Bugs
Any bugs raised by customers should be given priority in investigation. Red Hat developers will follow these steps when addressing bugs:
1. Determine whether the behaviour the customer describes is intended
1. If behaving as intended, inform customer
2. If customer pushes issue, they can raise with Red Hat business team
2. If so, determine whether this is a user error causing this to occur,
If user error, inform customer of what they’re doing incorrect
3. If a legitimate issue, determine whether this has been fixed already in later release
If so, backport
4. If not fixed yet, determine if reproducible upstream
1. If reproducible upstream, fix upstream and backport
2. If not reproducible upstream, was it unintentionally fixed?
1. If so, backport
2. If not, find where it was introduced through cherry pick and handle appropriately.




13 changes: 13 additions & 0 deletions addons/redhat/VERSIONING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Operator Releases
Operator releases are linked to openshift releases. Versioning will be consistent with versioning of Openshift releases and release builds.
Operator releases are branches cut from master downstream, and should reference upstream release tags, which should be merged in before cutting. Once it’s cut from that upstream tagged releases, everything should be brought in only by cherrypick not merge.

# Upstream Releases
Upstream releases should be tagged whenever there are significant new features added, or updated versions of key dependencies. Release notes should indicate these.
Upstream releases are tagged only. Tags will be done simultaneously in both upstream daemon and operator repos.

# Upstream linkage
When downstream branches are cut, link to latest upstream release. When backporting commits from upstream, there should be no changes to the upstream release the given downstream branch points to. Similar to how RHEL releases point to specific kernel versions, regardless of backported commits.

# Issue linkage
Upon tagging an upstream release, all github issues (bugs or features) should be included in release notes. Jira should be used for downstream tracking of these, referencing the downstream release it’s fixed in.
4 changes: 2 additions & 2 deletions bundle/manifests/ptp-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ metadata:
operators.operatorframework.io/builder: operator-sdk-v1.22.0-ocp
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
provider: Red Hat
repository: https://github.com/openshift/ptp-operator
repository: https://github.com/k8snetworkplumbingwg/ptp-operator
support: Red Hat
name: ptp-operator.v4.18.0
namespace: openshift-ptp
Expand Down Expand Up @@ -465,7 +465,7 @@ spec:
- ptp
links:
- name: Documentation operator
url: https://github.com/openshift/ptp-operator
url: https://github.com/k8snetworkplumbingwg/ptp-operator
- name: Documentation operand
url: https://github.com/openshift/linuxptp-daemon
maintainers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ metadata:
operatorframework.io/suggested-namespace: openshift-ptp
operators.openshift.io/infrastructure-features: '["disconnected"]'
provider: Red Hat
repository: https://github.com/openshift/ptp-operator
repository: https://github.com/k8snetworkplumbingwg/ptp-operator
support: Red Hat
name: ptp-operator.v0.0.0
namespace: openshift-ptp
Expand Down Expand Up @@ -166,7 +166,7 @@ spec:
- ptp
links:
- name: Documentation operator
url: https://github.com/openshift/ptp-operator
url: https://github.com/k8snetworkplumbingwg/ptp-operator
- name: Documentation operand
url: https://github.com/openshift/linuxptp-daemon
maintainers:
Expand Down
4 changes: 2 additions & 2 deletions controllers/ptpconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (

"github.com/go-logr/logr"
"github.com/golang/glog"
ptpv1 "github.com/openshift/ptp-operator/api/v1"
"github.com/openshift/ptp-operator/pkg/names"
ptpv1 "github.com/k8snetworkplumbingwg/ptp-operator/api/v1"
"github.com/k8snetworkplumbingwg/ptp-operator/pkg/names"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
8 changes: 4 additions & 4 deletions controllers/ptpoperatorconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import (

"github.com/go-logr/logr"
"github.com/golang/glog"
ptpv1 "github.com/openshift/ptp-operator/api/v1"
"github.com/openshift/ptp-operator/pkg/apply"
"github.com/openshift/ptp-operator/pkg/names"
"github.com/openshift/ptp-operator/pkg/render"
ptpv1 "github.com/k8snetworkplumbingwg/ptp-operator/api/v1"
"github.com/k8snetworkplumbingwg/ptp-operator/pkg/apply"
"github.com/k8snetworkplumbingwg/ptp-operator/pkg/names"
"github.com/k8snetworkplumbingwg/ptp-operator/pkg/render"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
Expand Down
2 changes: 1 addition & 1 deletion controllers/recommend.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/golang/glog"
corev1 "k8s.io/api/core/v1"

ptpv1 "github.com/openshift/ptp-operator/api/v1"
ptpv1 "github.com/k8snetworkplumbingwg/ptp-operator/api/v1"
)

func printWhenNotNil(p interface{}, description string) {
Expand Down
Binary file added doc/proposals/hardware-plugin/pins-api/flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading