Skip to content

Commit 8ccbbd6

Browse files
authored
Merge branch 'main' into edit-make-file-build-m1-support
2 parents 0974c74 + ed9bc20 commit 8ccbbd6

File tree

286 files changed

+7323
-37631
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

286 files changed

+7323
-37631
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Label new issues as needs-triage and add to CodeFlare Sprint Board
2+
on:
3+
issues:
4+
types:
5+
- opened
6+
jobs:
7+
add_label:
8+
name: Add needs-triage label to new issues
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
steps:
13+
- uses: actions/checkout@v3
14+
- run: gh issue edit ${{ github.event.issue.number }} --add-label "triage/needs-triage"
15+
env:
16+
GH_TOKEN: ${{ github.token }}
17+
18+
add-to-project:
19+
name: Add issue to project
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/[email protected]
23+
with:
24+
project-url: https://github.com/orgs/project-codeflare/projects/8
25+
github-token: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build and Push dev MCAD image into Quay
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: checkout code
14+
uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Set latest tag and Branch name
19+
run: |
20+
BRANCH=$(echo ${GITHUB_REF#refs/heads/})
21+
echo "GIT_BRANCH=$(echo "$BRANCH" | sed 's/[^A-Za-z0-9._-]/-/g' )" >> $GITHUB_ENV
22+
if [[ "$BRANCH" == "main" ]]; then
23+
echo "TAG=dev" >> $GITHUB_ENV
24+
elif [[ "$BRANCH" == release-* ]]; then
25+
echo "TAG=dev-$BRANCH" >> $GITHUB_ENV
26+
else
27+
LATEST_TAG=$(git describe --abbrev=0 --tags)
28+
echo "TAG=$BRANCH-$LATEST_TAG" >> $GITHUB_ENV
29+
fi
30+
31+
- name: Set up Go
32+
uses: actions/setup-go@v3
33+
with:
34+
go-version: 1.19.10
35+
36+
- name: Build
37+
run:
38+
make mcad-controller
39+
40+
- name: Run Unit tests
41+
run: make run-test
42+
43+
- name: Build Image
44+
run: |
45+
make images -e GIT_BRANCH=${{ env.GIT_BRANCH }} TAG=${{ env.TAG }}
46+
47+
- name: Push Image
48+
run: |
49+
make push-images -e GIT_BRANCH=${{ env.GIT_BRANCH }} TAG=${{ env.TAG }} quay_repository=quay.io/project-codeflare quay_id=${{ secrets.QUAY_ID }} quay_token=${{ secrets.QUAY_TOKEN }}
50+
51+
- name: Run E2E tests
52+
run: |
53+
make run-e2e -e GIT_BRANCH=${{ env.GIT_BRANCH }} TAG=${{ env.TAG }}

.github/workflows/mcad-CI.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This workflow will build mcad and run unit test and E2E tests
2+
name: MCAD-CI
3+
on:
4+
pull_request:
5+
branches:
6+
- 'main'
7+
- 'release-*'
8+
9+
jobs:
10+
MCAD-CI:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: checkout code
15+
uses: actions/checkout@v3
16+
with:
17+
ref: "refs/pull/${{ github.event.number }}/merge"
18+
fetch-depth: 0
19+
20+
- name: Set latest tag and Branch name
21+
run: |
22+
BRANCH=${{ github.event.pull_request.head.ref }}
23+
echo "GIT_BRANCH=$(echo "$BRANCH" | sed 's/[^A-Za-z0-9._-]/-/g' )" >> $GITHUB_ENV
24+
echo "TAG=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV
25+
26+
- name: Set up Go
27+
uses: actions/setup-go@v3
28+
with:
29+
go-version: 1.19.10
30+
31+
- name: Build
32+
run:
33+
make mcad-controller
34+
35+
- name: Run Unit tests
36+
run: make run-test
37+
38+
- name: Build Image
39+
run: |
40+
make images -e GIT_BRANCH=${{ env.GIT_BRANCH }} TAG=${{ env.GIT_BRANCH }}-${{ env.TAG }}
41+
42+
- name: Run E2E tests
43+
run: |
44+
make run-e2e -e GIT_BRANCH=${{ env.GIT_BRANCH }} TAG=${{ env.GIT_BRANCH }}-${{ env.TAG }}
45+

.github/workflows/mcad-release.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This workflow will create a GitHub release tag
1+
# This workflow will Build image and push to mcad quay repository and create a GitHub release tag
22

33
name: mcad Release
44
on:
@@ -9,6 +9,11 @@ on:
99
required: true
1010
default: 'v0.0.0-dev'
1111
type: string
12+
quay-organization:
13+
description: 'Quay organization used to push the built images to'
14+
required: true
15+
default: 'project-codeflare'
16+
type: string
1217

1318
jobs:
1419
release:
@@ -20,6 +25,8 @@ jobs:
2025
steps:
2126
- name: checkout code
2227
uses: actions/checkout@v3
28+
with:
29+
fetch-depth: 0
2330

2431
- name: check tag format
2532
run: |
@@ -41,3 +48,18 @@ jobs:
4148
env:
4249
GITHUB_TOKEN: ${{ github.token }}
4350

51+
- name: Build
52+
run: make mcad-controller
53+
54+
- name: Image Build and Push
55+
env:
56+
GIT_BRANCH: ${{ github.event.inputs.tag }}
57+
TAG: release-${{ github.event.inputs.tag }}
58+
run: |
59+
make images -e GIT_BRANCH=$GIT_BRANCH TAG=$TAG
60+
make push-images -e GIT_BRANCH=$GIT_BRANCH TAG=$TAG quay_repository=quay.io/${{ github.event.inputs.quay-organization }} quay_id=${{ secrets.QUAY_ID }} quay_token=${{ secrets.QUAY_TOKEN }}
61+
62+
- name: Publish MCAD package
63+
run: |
64+
GOPROXY=proxy.golang.org go list -m github.com/project-codeflare/multi-cluster-app-dispatcher@${{ github.event.inputs.tag }}
65+
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Update CodeFlare operator with latest changes from MCAD
2+
3+
on:
4+
workflow_run:
5+
workflows: [Build and Push dev MCAD image into Quay]
6+
types:
7+
- completed
8+
9+
jobs:
10+
update-codeflare-operator:
11+
runs-on: ubuntu-latest
12+
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' && github.repository == 'project-codeflare/multi-cluster-app-dispatcher'
13+
14+
steps:
15+
- name: checkout MCAD code
16+
uses: actions/checkout@v3
17+
with:
18+
path: 'mcad'
19+
20+
- name: Store latest MCAD Git SHA
21+
run: |
22+
echo "GIT_COMMIT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
23+
working-directory: mcad
24+
25+
- name: checkout CodeFlare operator code
26+
uses: actions/checkout@v3
27+
with:
28+
repository: 'project-codeflare/codeflare-operator'
29+
token: ${{ env.GITHUB_TOKEN }}
30+
path: operator
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
33+
34+
- name: Update CodeFlare operator code to use latest MCAD version
35+
run: |
36+
sed -i -E "s/(.*MCAD_VERSION \?= ).*/\1${{ env.GIT_COMMIT_SHA }}/" Makefile
37+
sed -i -E "s/(.*MCAD_REF \?= ).*/\1dev/" Makefile
38+
make modules
39+
go mod tidy
40+
working-directory: operator
41+
42+
- name: Commit CodeFlare operator changes in the code back to repository
43+
uses: stefanzweifel/git-auto-commit-action@v4
44+
with:
45+
commit_message: Update MCAD to latest dev
46+
create_branch: true
47+
repository: operator
48+
branch: dev
49+
push_options: '--force'
50+
51+
- name: Create a PR in CodeFlare operator repo with code changes if not opened yet
52+
run: |
53+
if [[ $(gh pr view dev) && $(gh pr view dev --json state --jq .state) == "OPEN" ]]; then
54+
echo "PR already opened"
55+
else
56+
gh pr create --base "main" --fill --head dev
57+
fi
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
60+
working-directory: operator

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
/output*/
2121
/_output*/
2222
/_output
23+
bin
2324

2425
# Emacs save files
2526
*~

.travis.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.access.redhat.com/ubi8/go-toolset:1.18.10-1 AS BUILDER
1+
FROM registry.access.redhat.com/ubi8/go-toolset:1.19.10-10 AS BUILDER
22
ARG GO_BUILD_ARGS
33
WORKDIR /workdir
44
USER root
@@ -10,15 +10,13 @@ COPY cmd cmd
1010
COPY pkg pkg
1111
COPY hack hack
1212

13-
RUN cd /workdir && curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/$(go env GOARCH)/kubectl && chmod +x kubectl
1413
ENV GO_BUILD_ARGS=$GO_BUILD_ARGS
1514
RUN echo "Go build args: $GO_BUILD_ARGS" && \
1615
make mcad-controller
1716

1817
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
1918

2019
COPY --from=BUILDER /workdir/_output/bin/mcad-controller /usr/local/bin
21-
COPY --from=BUILDER /workdir/kubectl /usr/local/bin
2220

2321
RUN true \
2422
&& microdnf update \

0 commit comments

Comments
 (0)