Skip to content

Commit

Permalink
Merge branch 'nephio-project:main' into fix-porchctl-cmds
Browse files Browse the repository at this point in the history
  • Loading branch information
dgeorgievski authored Nov 13, 2024
2 parents b6a401e + a69870d commit 1152765
Show file tree
Hide file tree
Showing 230 changed files with 6,153 additions and 13,893 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.cache/
default.etcd/
apiserver.local.config/
__debug_bin*
79 changes: 79 additions & 0 deletions .github/workflows/dev-image-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Dev Image Build

on:
push:
branches:
- main
paths-ignore:
- "docs/**"
- "release/**"
- ".prow.yaml"
- "OWNERS"
workflow_dispatch:

env:
REGISTRY: docker.io
ORG: nephio

permissions:
contents: read

jobs:
build-and-push-image:
if: github.repository_owner == 'nephio-project'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- dockerfile: ./build/Dockerfile
image: docker.io/nephio/porch-server
- dockerfile: ./controllers/Dockerfile
image: docker.io/nephio/porch-controllers
- dockerfile: ./func/Dockerfile
image: docker.io/nephio/porch-function-runner
- dockerfile: ./func/Dockerfile-wrapperserver
image: docker.io/nephio/porch-wrapper-server
permissions:
contents: read
packages: write

steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Log in to the Container registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1

- name: Extract metadata
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
with:
images: ${{ matrix.image }}
tags: |
type=sha
- name: Build and push Docker images
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: |
${{ steps.meta.outputs.tags }}
${{ matrix.image }}:latest
labels: ${{ steps.meta.outputs.labels }}
no-cache: true
sbom: true
10 changes: 5 additions & 5 deletions .github/workflows/porch-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ on:
paths-ignore:
- "docs/**"
- "release/**"
- "deployments/**"
- ".prow.yaml"
- "OWNERS"
pull_request:
paths-ignore:
- "docs/**"
- "release/**"
- "deployments/**"
- ".prow.yaml"
- "OWNERS"
jobs:
Expand All @@ -48,16 +46,18 @@ jobs:
uses: jaxxstorm/[email protected]
with:
repo: kptdev/kpt
tag: v1.0.0-beta.49
tag: v1.0.0-beta.54
chmod: 0755
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1
with:
cluster_name: kind
version: v0.23.0
kubectl_version: v1.30.0
- name: Build Images and Deploy porch kpt pkg
run: IMAGE_REPO=porch-kind IMAGE_TAG=${GITHUB_SHA:0:8} KIND_CONTEXT_NAME=kind make run-in-kind
- name: Sleep for 15 seconds
run: sleep 15s
- name: Sleep for 30 seconds
run: sleep 30s
shell: bash
- name: e2e test
run: E2E=1 go test -v -timeout 20m ${GITHUB_WORKSPACE}/test/e2e
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/porchctl-cli-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ on:
paths-ignore:
- "docs/**"
- "release/**"
- "deployments/**"
- ".prow.yaml"
- "OWNERS"
pull_request:
paths-ignore:
- "docs/**"
- "release/**"
- "deployments/**"
- ".prow.yaml"
- "OWNERS"
jobs:
Expand All @@ -46,17 +44,18 @@ jobs:
uses: jaxxstorm/[email protected]
with:
repo: kptdev/kpt
tag: v1.0.0-beta.49
tag: v1.0.0-beta.54
chmod: 0755
- name: Build and install porchctl
run: |
go build -o ${GITHUB_WORKSPACE}.build/ ./cmd/porchctl
mv ${GITHUB_WORKSPACE}.build/porchctl /usr/local/bin/porchctl
sudo chmod 755 /usr/local/bin/porchctl
make porchctl
.build/porchctl version
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1
with:
cluster_name: kind
version: v0.23.0
kubectl_version: v1.30.0
- name: Build Images and Deploy porch kpt pkg
run: IMAGE_REPO=porch-kind IMAGE_TAG=${GITHUB_SHA:0:8} KIND_CONTEXT_NAME=kind make run-in-kind
- name: porchctl e2e test
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/porchctl-dev-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@
# limitations under the License.

name: porchctl dev release

# build and update the porchctl on merge to main branch
on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
name: porchctl-dev-release
outputs:
hashes: ${{ steps.hash.outputs.hashes }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ name: porchctl Release
on:
push:
tags:
- "v[1-9].*.*"
- "v[0-9]+.[0-9]+.[0-9]"

jobs:
build:
Expand All @@ -41,4 +41,4 @@ jobs:
version: latest
args: release --skip-validate -f release/tag/goreleaser.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
164 changes: 0 additions & 164 deletions .prow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,167 +9,3 @@ presubmits:
- make
args:
- ci-unit
postsubmits:
- name: build-push-porch-server-dev-image
cluster: default
always_run: true
branches:
- "main"
annotations:
description: Build and Push Dev Image to DockerHub
decorate: true
decoration_config:
censor_secrets: true
max_concurrency: 1
extra_refs:
- org: nephio-project
repo: porch
base_ref: main
path_alias: "porch_build"
spec:
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:debug
command:
- "/bin/sh"
- "-c"
- |
executor --context=/home/prow/go/src/porch_build/ --dockerfile=build/Dockerfile --destination=nephio/porch-server:${PULL_BASE_REF} --destination=nephio/porch-server:latest
volumeMounts:
- name: kaniko-secret
mountPath: /kaniko/.docker/
resources:
requests:
cpu: 1
memory: 1Gi
volumes:
- name: kaniko-secret
secret:
secretName: regcred
items:
- key: .dockerconfigjson
path: config.json


- name: build-push-porch-controllers-dev-image
cluster: default
always_run: true
branches:
- "main"
annotations:
description: Build and Push Dev Image to DockerHub
decorate: true
decoration_config:
censor_secrets: true
max_concurrency: 1
extra_refs:
- org: nephio-project
repo: porch
base_ref: main
path_alias: "porch_build"
spec:
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:debug
command:
- "/bin/sh"
- "-c"
- |
executor --context=/home/prow/go/src/porch_build/ --dockerfile=controllers/Dockerfile --destination=nephio/porch-controllers:${PULL_BASE_REF} --destination=nephio/porch-controllers:latest
volumeMounts:
- name: kaniko-secret
mountPath: /kaniko/.docker/
resources:
requests:
cpu: 1
memory: 1Gi
volumes:
- name: kaniko-secret
secret:
secretName: regcred
items:
- key: .dockerconfigjson
path: config.json


- name: build-push-porch-function-runner-dev-image
cluster: default
always_run: true
branches:
- "main"
annotations:
description: Build and Push Dev Image to DockerHub
decorate: true
decoration_config:
censor_secrets: true
max_concurrency: 1
extra_refs:
- org: nephio-project
repo: porch
base_ref: main
path_alias: "porch_build"
spec:
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:debug
command:
- "/bin/sh"
- "-c"
- |
executor --context=/home/prow/go/src/porch_build/ --dockerfile=func/Dockerfile --destination=nephio/porch-function-runner:${PULL_BASE_REF} --destination=nephio/porch-function-runner:latest
volumeMounts:
- name: kaniko-secret
mountPath: /kaniko/.docker/
resources:
requests:
cpu: 1
memory: 1Gi
volumes:
- name: kaniko-secret
secret:
secretName: regcred
items:
- key: .dockerconfigjson
path: config.json


- name: build-push-porch-wrapper-server-dev-image
cluster: default
always_run: true
branches:
- "main"
annotations:
description: Build and Push Dev Image to DockerHub
decorate: true
decoration_config:
censor_secrets: true
max_concurrency: 1
extra_refs:
- org: nephio-project
repo: porch
base_ref: main
path_alias: "porch_build"
spec:
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:debug
command:
- "/bin/sh"
- "-c"
- |
executor --context=/home/prow/go/src/porch_build/ --dockerfile=func/Dockerfile-wrapperserver --destination=nephio/porch-wrapper-server:${PULL_BASE_REF} --destination=nephio/porch-wrapper-server:latest
volumeMounts:
- name: kaniko-secret
mountPath: /kaniko/.docker/
resources:
requests:
cpu: 1
memory: 1Gi
volumes:
- name: kaniko-secret
secret:
secretName: regcred
items:
- key: .dockerconfigjson
path: config.json

7 changes: 3 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@
"program": "${workspaceFolder}/cmd/porch/main.go",
"args": [
"--secure-port=4443",
// "--v=7",
// "--standalone-debug-mode",
"--kubeconfig=${env:KUBECONFIG}",
"--cache-directory=${workspaceFolder}/.cache",
"--function-runner=172.18.255.201:9445",
"--function-runner=${env:FUNCTION_RUNNER_IP}:9445",
"--repo-sync-frequency=60s"
],
"cwd": "${workspaceFolder}",
"env": {
"CERT_STORAGE_DIR": "${workspaceFolder}/.build/pki/tmp",
"WEBHOOK_HOST": "localhost"
"WEBHOOK_HOST": "localhost",
"GOOGLE_API_GO_EXPERIMENTAL_DISABLE_NEW_AUTH_LIB": "true"
}
},
{
Expand Down
Loading

0 comments on commit 1152765

Please sign in to comment.