Skip to content

Commit

Permalink
Update github actions for releasing manifests and images
Browse files Browse the repository at this point in the history
Signed-off-by: Parth Yadav <[email protected]>
  • Loading branch information
parthyadav3105 committed Sep 12, 2024
1 parent d95384c commit ba1a5f4
Show file tree
Hide file tree
Showing 55 changed files with 376 additions and 323 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release-byoh-controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release BYOH controller

on:
push:
# Build and publish artifacts when new tag is created for release
tags:
- "v*.*.*"


jobs:
build-and-publish-byoh-controller:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Login to Docker Hub
env:
DOCKER_USER: ${{secrets.DOCKERHUB_USER}}
DOCKER_PWD: ${{secrets.DOCKERHUB_USER}}
run: docker login -u $DOCKER_USER -p $DOCKER_PWD

- name: pre-cleanup the docker
run: sudo docker system prune -a -f && sudo docker buildx prune

- name: build and push controller image
env:
REPO: ${{ github.repository_owner }}
TAG: ${{ github.ref_name }}
run: |
IMG=$REPO/cluster-api-byoh-controller:$TAG make docker-build
docker push $REPO/cluster-api-byoh-controller:$TAG
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: Build and Publish BYOH Bundle
name: Release k8s BYOH Bundles

on:
release:
types: [published]
push:
# Build and publish artifacts when new tag is created for release
tags:
- '*'
- "v*.*.*"

jobs:
build-and-publish-k8s-bundles:
Expand All @@ -17,8 +16,8 @@ jobs:
- name: Login to Docker Hub
env:
DOCKER_USER: ${{secrets.DOCKERHUB_USER}}
DOCKER_PWD: ${{secrets.DOCKERHUB_PUSH_TOKEN}}
run: sudo docker login -u $DOCKER_USER -p $DOCKER_PWD
DOCKER_PWD: ${{secrets.DOCKERHUB_USER}}
run: docker login -u $DOCKER_USER -p $DOCKER_PWD

- name: pre-cleanup the docker
run: sudo docker system prune -a -f && sudo docker buildx prune
Expand All @@ -41,10 +40,12 @@ jobs:
- name: Build and Publish BYOH Bundle
env:
BUILD_ONLY: 0
REPO: coredgeio
BUNDLE_NAME: ${{ github.ref_name }}
REPO: ${{ github.repository_owner }}
BUNDLE_NAME: byoh-bundle-ubuntu_20.04.1_x86-64_k8s
TAG: v1.31.0
run: |
docker run --rm -v ${{ github.workspace }}/byoh-ingredients-download:/ingredients --env BUILD_ONLY=${{ env.BUILD_ONLY }} byoh-build-push-bundle ${REPO}/${BUNDLE_NAME}
docker run --rm -v ~/.docker/config.json:/root/.docker/config.json -v ${{ github.workspace }}/byoh-ingredients-download:/ingredients --env BUILD_ONLY=${{ env.BUILD_ONLY }} byoh-build-push-bundle $REPO/$BUNDLE_NAME:$TAG
- name: Cleanup Docker
run: sudo docker logout && sudo docker system prune -a -f && sudo docker buildx prune

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Draft Release
name: Release

on:
push:
Expand All @@ -20,7 +20,7 @@ jobs:
go-version: 1.20.7

- name: Build Release Artifacts
run: IMG="coredgeio/cluster-api-byoh-controller:${{ github.ref_name }}" make build-release-artifacts
run: IMG="docker.io/coredgeio/cluster-api-byoh-controller:${{ github.ref_name }}" make build-release-artifacts

- name: Publish Release
uses: softprops/action-gh-release@v1
Expand Down
2 changes: 1 addition & 1 deletion ADOPTERS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## Adding your organization to the list of Bring Your Own Host Provider Adopters

If you are using BYOH and would like to be included in the list of `BYOH Adopters`, add an SVG version of your logo to the `static/img/adopters` directory in this repo and submit a [pull request](https://github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/pulls) with your change. Name the image file something that reflects your company (e.g., if your company is called Acme, name the image acme.png).
If you are using BYOH and would like to be included in the list of `BYOH Adopters`, add an SVG version of your logo to the `static/img/adopters` directory in this repo and submit a [pull request](https://github.com/coredgeio/cluster-api-provider-bringyourownhost/pulls) with your change. Name the image file something that reflects your company (e.g., if your company is called Acme, name the image acme.png).
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## As a Contributor
### Fork and branch
Local development has to be done in the forked repo of [cluster-api-provider-bringyourownhost](https://github.com/vmware-tanzu/cluster-api-provider-bringyourownhost). Here are some examples of meaningful branch names
Local development has to be done in the forked repo of [cluster-api-provider-bringyourownhost](https://github.com/coredgeio/cluster-api-provider-bringyourownhost). Here are some examples of meaningful branch names
* add-host-reservation-logic
* update-readme
* fix-byomachine-controller-flakes
Expand All @@ -25,7 +25,7 @@ At the minimum,
* write (at least) another couple of lines explaining why the commit is necessary or what is the reasoning behind certain code logic

### Raising a PR
* all PRs should be raised against the main branch of [cluster-api-provider-bringyourownhost](https://github.com/vmware-tanzu/cluster-api-provider-bringyourownhost)
* all PRs should be raised against the main branch of [cluster-api-provider-bringyourownhost](https://github.com/coredgeio/cluster-api-provider-bringyourownhost)
* all code changes should be accompanied with corresponding unit / integration tests (if for some reason, the code is not unit / integration testable, add enough justification in the PR. Although, this almost should never be the case.)
* all the commits made in the PR should be squashed into one single commit before the final merge by the PR author themselves such that it would be easier to track the commits in Git history.

Expand Down
16 changes: 8 additions & 8 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ layout:
- go.kubebuilder.io/v3
multigroup: true
projectName: byoh
repo: github.com/vmware-tanzu/cluster-api-provider-bringyourownhost
repo: github.com/coredgeio/cluster-api-provider-bringyourownhost
resources:
- api:
crdVersion: v1
namespaced: true
domain: cluster.x-k8s.io
group: infrastructure
kind: ByoMachine
path: github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/apis/infrastructure/v1beta1
path: github.com/coredgeio/cluster-api-provider-bringyourownhost/apis/infrastructure/v1beta1
version: v1beta1
- api:
crdVersion: v1
namespaced: true
domain: cluster.x-k8s.io
group: infrastructure
kind: ByoHost
path: github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/apis/infrastructure/v1beta1
path: github.com/coredgeio/cluster-api-provider-bringyourownhost/apis/infrastructure/v1beta1
version: v1beta1
webhooks:
validation: true
Expand All @@ -30,7 +30,7 @@ resources:
domain: cluster.x-k8s.io
group: infrastructure
kind: ByoCluster
path: github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/apis/infrastructure/v1beta1
path: github.com/coredgeio/cluster-api-provider-bringyourownhost/apis/infrastructure/v1beta1
version: v1beta1
webhooks:
defaulting: true
Expand All @@ -42,7 +42,7 @@ resources:
domain: cluster.x-k8s.io
group: infrastructure
kind: ByoMachineTemplate
path: github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/apis/infrastructure/v1beta1
path: github.com/coredgeio/cluster-api-provider-bringyourownhost/apis/infrastructure/v1beta1
version: v1beta1
- api:
crdVersion: v1
Expand All @@ -51,15 +51,15 @@ resources:
domain: cluster.x-k8s.io
group: infrastructure
kind: K8sInstallerConfig
path: github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/apis/infrastructure/v1beta1
path: github.com/coredgeio/cluster-api-provider-bringyourownhost/apis/infrastructure/v1beta1
version: v1beta1
- api:
crdVersion: v1
namespaced: true
domain: cluster.x-k8s.io
group: infrastructure
kind: K8sInstallerConfigTemplate
path: github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/apis/infrastructure/v1beta1
path: github.com/coredgeio/cluster-api-provider-bringyourownhost/apis/infrastructure/v1beta1
version: v1beta1
- api:
crdVersion: v1
Expand All @@ -68,7 +68,7 @@ resources:
domain: cluster.x-k8s.io
group: infrastructure
kind: BootstrapKubeconfig
path: github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/apis/infrastructure/v1beta1
path: github.com/coredgeio/cluster-api-provider-bringyourownhost/apis/infrastructure/v1beta1
version: v1beta1
webhooks:
validation: true
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Kubernetes Cluster API Provider Bring Your Own Host (BYOH)
<p align="center">
<!-- lint card --><a href="https://github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/actions/workflows/lint.yml">
<img src="https://github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/actions/workflows/lint.yml/badge.svg"></a>
<!-- lint card --><a href="https://github.com/coredgeio/cluster-api-provider-bringyourownhost/actions/workflows/lint.yml">
<img src="https://github.com/coredgeio/cluster-api-provider-bringyourownhost/actions/workflows/lint.yml/badge.svg"></a>
<!-- test status -->
<a href="https://github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/actions?query=event%3Apush+branch%3Amain+workflow%3ACI+">
<img src="https://github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/actions/workflows/ci.yml/badge.svg?branch=main&event=push"></a>
<a href="https://github.com/coredgeio/cluster-api-provider-bringyourownhost/actions?query=event%3Apush+branch%3Amain+workflow%3ACI+">
<img src="https://github.com/coredgeio/cluster-api-provider-bringyourownhost/actions/workflows/ci.yml/badge.svg?branch=main&event=push"></a>
<!-- go doc / reference card -->
<a href="https://pkg.go.dev/github.com/vmware-tanzu/cluster-api-provider-bringyourownhost">
<img src="https://pkg.go.dev/badge/github.com/vmware-tanzu/cluster-api-provider-bringyourownhost.svg"></a>
<a href="https://pkg.go.dev/github.com/coredgeio/cluster-api-provider-bringyourownhost">
<img src="https://pkg.go.dev/badge/github.com/coredgeio/cluster-api-provider-bringyourownhost.svg"></a>
<!-- goreportcard badge -->
<a href="https://goreportcard.com/report/github.com/vmware-tanzu/cluster-api-provider-bringyourownhost">
<img src="https://goreportcard.com/badge/github.com/vmware-tanzu/cluster-api-provider-bringyourownhost"></a>
<a href="https://goreportcard.com/report/github.com/coredgeio/cluster-api-provider-bringyourownhost">
<img src="https://goreportcard.com/badge/github.com/coredgeio/cluster-api-provider-bringyourownhost"></a>
<!-- codecov badge -->
<a href="https://codecov.io/gh/vmware-tanzu/cluster-api-provider-bringyourownhost">
<img src="https://codecov.io/gh/vmware-tanzu/cluster-api-provider-bringyourownhost/branch/main/graph/badge.svg?token=8GGPY0MENQ"></a>
Expand Down Expand Up @@ -47,7 +47,7 @@ __BYOH__ is a Cluster API Infrastructure Provider for already-provisioned hosts
- Support already provisioned Linux VMs with Ubuntu 20.04

## Getting Started
Check out the [getting_started](https://github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/blob/main/docs/getting_started.md) guide for launching a BYOH workload cluster
Check out the [getting_started](https://github.com/coredgeio/cluster-api-provider-bringyourownhost/blob/main/docs/getting_started.md) guide for launching a BYOH workload cluster

## Community, discussion, contribution, and support

Expand All @@ -61,15 +61,15 @@ If you have questions or want to get the latest project news, you can connect wi
- Previous meetings: \[ [notes](https://docs.google.com/document/d/1T-3_eskC_HCtXLh3PA8y--mgO-AIajZfevcnYuno6JM/edit#heading=h.y186zgz0eh6e) | [recordings](https://www.youtube.com/playlist?list=PLHbHoGHbooH41L5P-tIK6QqhILdEI9yBK) \]

Pull Requests and feedback on issues are very welcome!
See the [issue tracker](https://github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/issues) if you're unsure where to start, especially the [Good first issue](https://github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) and [Help wanted](https://github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) tags, and
See the [issue tracker](https://github.com/coredgeio/cluster-api-provider-bringyourownhost/issues) if you're unsure where to start, especially the [Good first issue](https://github.com/coredgeio/cluster-api-provider-bringyourownhost/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) and [Help wanted](https://github.com/coredgeio/cluster-api-provider-bringyourownhost/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) tags, and
also feel free to reach out to discuss.

See also our [contributor guide](CONTRIBUTING.md) and the Kubernetes [community page](https://kubernetes.io/community) for more details on how to get involved.


## Project Status

This project is currently a work-in-progress, in an Alpha state, so it may not be production ready. There is no backwards-compatibility guarantee at this point. For more details on the roadmap and upcoming features, check out the project's [issue](https://github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/issues) tracker on GitHub.
This project is currently a work-in-progress, in an Alpha state, so it may not be production ready. There is no backwards-compatibility guarantee at this point. For more details on the roadmap and upcoming features, check out the project's [issue](https://github.com/coredgeio/cluster-api-provider-bringyourownhost/issues) tracker on GitHub.


## Getting involved and contributing
Expand Down
2 changes: 1 addition & 1 deletion agent/cloudinit/cloudinit.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"

"github.com/pkg/errors"
"github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/common"
"github.com/coredgeio/cluster-api-provider-bringyourownhost/common"
"sigs.k8s.io/yaml"
)

Expand Down
6 changes: 3 additions & 3 deletions agent/cloudinit/cloudinit_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"path"
"strconv"

"github.com/coredgeio/cluster-api-provider-bringyourownhost/agent/cloudinit"
"github.com/coredgeio/cluster-api-provider-bringyourownhost/agent/registration"
"github.com/coredgeio/cluster-api-provider-bringyourownhost/common"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/agent/cloudinit"
"github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/agent/registration"
"github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/common"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions agent/cloudinit/cloudinit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/agent/cloudinit"
"github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/agent/cloudinit/cloudinitfakes"
"github.com/coredgeio/cluster-api-provider-bringyourownhost/agent/cloudinit"
"github.com/coredgeio/cluster-api-provider-bringyourownhost/agent/cloudinit/cloudinitfakes"
)

var _ = Describe("Cloudinit", func() {
Expand Down
2 changes: 1 addition & 1 deletion agent/cloudinit/cloudinitfakes/fake_icmd_runner.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agent/cloudinit/cloudinitfakes/fake_ifile_writer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agent/cloudinit/cloudinitfakes/fake_itemplate_parser.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agent/cloudinit/file_writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/agent/cloudinit"
"github.com/coredgeio/cluster-api-provider-bringyourownhost/agent/cloudinit"
)

var _ = Describe("FileWriter", func() {
Expand Down
6 changes: 3 additions & 3 deletions agent/host_agent_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gexec"
infrastructurev1beta1 "github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/apis/infrastructure/v1beta1"
"github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/test/e2e"
infrastructurev1beta1 "github.com/coredgeio/cluster-api-provider-bringyourownhost/apis/infrastructure/v1beta1"
"github.com/coredgeio/cluster-api-provider-bringyourownhost/test/e2e"
certv1 "k8s.io/api/certificates/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -103,7 +103,7 @@ var _ = BeforeSuite(func() {
dockerClient, err = dClient.NewClientWithOpts(dClient.FromEnv, dClient.WithAPIVersionNegotiation())
Expect(err).NotTo(HaveOccurred())

pathToHostAgentBinary, err = gexec.Build("github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/agent")
pathToHostAgentBinary, err = gexec.Build("github.com/coredgeio/cluster-api-provider-bringyourownhost/agent")
Expect(err).NotTo(HaveOccurred())

writeKubeConfig()
Expand Down
26 changes: 13 additions & 13 deletions agent/host_agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gexec"
"github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/agent/registration"
"github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/agent/version"
infrastructurev1beta1 "github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/apis/infrastructure/v1beta1"
"github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/test/builder"
"github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/test/e2e"
"github.com/coredgeio/cluster-api-provider-bringyourownhost/agent/registration"
"github.com/coredgeio/cluster-api-provider-bringyourownhost/agent/version"
infrastructurev1beta1 "github.com/coredgeio/cluster-api-provider-bringyourownhost/apis/infrastructure/v1beta1"
"github.com/coredgeio/cluster-api-provider-bringyourownhost/test/builder"
"github.com/coredgeio/cluster-api-provider-bringyourownhost/test/e2e"
certv1 "k8s.io/api/certificates/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -358,15 +358,15 @@ var _ = Describe("Agent", func() {
version.GitTreeState = "clean"
version.BuildDate = string(date)

ldflags := fmt.Sprintf("-X 'github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/agent/version.GitMajor=%s'"+
"-X 'github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/agent/version.GitMinor=%s'"+
"-X 'github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/agent/version.GitVersion=%s'"+
"-X 'github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/agent/version.GitCommit=%s'"+
"-X 'github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/agent/version.GitTreeState=%s'"+
"-X 'github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/agent/version.BuildDate=%s'",
ldflags := fmt.Sprintf("-X 'github.com/coredgeio/cluster-api-provider-bringyourownhost/agent/version.GitMajor=%s'"+
"-X 'github.com/coredgeio/cluster-api-provider-bringyourownhost/agent/version.GitMinor=%s'"+
"-X 'github.com/coredgeio/cluster-api-provider-bringyourownhost/agent/version.GitVersion=%s'"+
"-X 'github.com/coredgeio/cluster-api-provider-bringyourownhost/agent/version.GitCommit=%s'"+
"-X 'github.com/coredgeio/cluster-api-provider-bringyourownhost/agent/version.GitTreeState=%s'"+
"-X 'github.com/coredgeio/cluster-api-provider-bringyourownhost/agent/version.BuildDate=%s'",
version.GitMajor, version.GitMinor, version.GitVersion, version.GitCommit, version.GitTreeState, version.BuildDate)

tmpHostAgentBinary, err = gexec.Build("github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/agent", "-ldflags", ldflags)
tmpHostAgentBinary, err = gexec.Build("github.com/coredgeio/cluster-api-provider-bringyourownhost/agent", "-ldflags", ldflags)
Expect(err).NotTo(HaveOccurred())
})

Expand Down Expand Up @@ -424,7 +424,7 @@ var _ = Describe("Agent", func() {
root, _ := exec.Command("/bin/sh", "-c", "git rev-parse --show-toplevel").Output()
cmd := exec.Command("/bin/sh", "-c", strings.TrimSuffix(string(root), "\n")+"/hack/version.sh")
ldflags, _ := cmd.Output()
tmpHostAgentBinary, err = gexec.Build("github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/agent", "-ldflags", string(ldflags))
tmpHostAgentBinary, err = gexec.Build("github.com/coredgeio/cluster-api-provider-bringyourownhost/agent", "-ldflags", string(ldflags))
Expect(err).NotTo(HaveOccurred())
})

Expand Down
Loading

0 comments on commit ba1a5f4

Please sign in to comment.