Skip to content

Commit

Permalink
Add workflow to build vreplicaset controller (#492)
Browse files Browse the repository at this point in the history
Signed-off-by: Xudong Sun <[email protected]>
  • Loading branch information
marshtompsxd authored Jun 5, 2024
1 parent 70e8f38 commit 262c55b
Show file tree
Hide file tree
Showing 11 changed files with 121 additions and 233 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
vargo build --release
- name: Verify zookeeper controller
run: VERUS_DIR="$(dirname "${PWD}")/verus" ./build.sh zookeeper_controller.rs --time --rlimit 50
replica-set-verification:
vreplicaset-verification:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
Expand All @@ -102,8 +102,8 @@ jobs:
./tools/get-z3.sh
source ../tools/activate
vargo build --release
- name: Verify replica set controller
run: VERUS_DIR="$(dirname "${PWD}")/verus" ./build.sh v_replica_set_controller.rs --time
- name: Verify vreplicaset controller
run: VERUS_DIR="$(dirname "${PWD}")/verus" ./build.sh vreplicaset_controller.rs --time
unit-tests:
runs-on: ubuntu-20.04
steps:
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/controller-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,22 @@ jobs:
run: |
docker push ghcr.io/${{ env.IMAGE_NAME }}/fluent-controller:latest
docker push ghcr.io/${{ env.IMAGE_NAME }}/fluent-controller:${{ github.sha }}
build-vreplicaset-controller:
runs-on: ubuntu-20.04
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log into registry ghcr.io
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
- name: Build vreplicaset controller image
run: |
cp docker/controller/Dockerfile .
docker build -t ghcr.io/${{ env.IMAGE_NAME }}/vreplicaset-controller:latest --build-arg APP=vreplicaset .
docker tag ghcr.io/${{ env.IMAGE_NAME }}/vreplicaset-controller:latest ghcr.io/${{ env.IMAGE_NAME }}/vreplicaset-controller:${{ github.sha }}
- name: Push vreplicaset controller image
run: |
docker push ghcr.io/${{ env.IMAGE_NAME }}/vreplicaset-controller:latest
docker push ghcr.io/${{ env.IMAGE_NAME }}/vreplicaset-controller:${{ github.sha }}
4 changes: 2 additions & 2 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ app=$1
registry=$2

if [ "$app" != "zookeeper" ] && [ "$app" != "rabbitmq" ] && [ "$app" != "fluent" ]\
&& [ "$app" != "v_stateful_set" ]; then
echo -e "${RED}The first argument has to be one of: zookeeper, rabbitmq, fluent.${NC}"
[ "$app" != "vreplicaset" ] && [ "$app" != "v_stateful_set" ]; then
echo -e "${RED}The first argument has to be one of: zookeeper, rabbitmq, fluent, vreplicaset, v_stateful_set.${NC}"
exit 1
fi

Expand Down
35 changes: 0 additions & 35 deletions deploy/simple/crd.yaml

This file was deleted.

186 changes: 0 additions & 186 deletions deploy/simple/deploy.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions deploy/simple/simplecr.yaml

This file was deleted.

File renamed without changes.
22 changes: 22 additions & 0 deletions deploy/vreplicaset/deploy_local.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: vreplicaset-controller
namespace: vreplicaset
labels:
app.kubernetes.io/name: vreplicaset-controller
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: vreplicaset-controller
template:
metadata:
labels:
app.kubernetes.io/name: vreplicaset-controller
spec:
containers:
- image: local/vreplicaset-controller:v0.1.0
imagePullPolicy: IfNotPresent
name: controller
serviceAccountName: vreplicaset-controller
21 changes: 21 additions & 0 deletions deploy/vreplicaset/deploy_remote.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: vreplicaset-controller
namespace: vreplicaset
labels:
app.kubernetes.io/name: vreplicaset-controller
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: vreplicaset-controller
template:
metadata:
labels:
app.kubernetes.io/name: vreplicaset-controller
spec:
containers:
- image: ghcr.io/vmware-research/verifiable-controllers/vreplicaset-controller:latest
name: controller
serviceAccountName: vreplicaset-controller
54 changes: 54 additions & 0 deletions deploy/vreplicaset/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
app.kubernetes.io/name: vreplicaset
name: vreplicaset
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: vreplicaset-controller
namespace: vreplicaset
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: vreplicaset-controller
name: vreplicaset-controller-role
rules:
- apiGroups:
- anvil.dev
resources:
- "*"
verbs:
- "*"
- apiGroups:
- ""
resources:
- pods
- services
- endpoints
- persistentvolumeclaims
- events
- configmaps
- secrets
- serviceaccounts
verbs:
- "*"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/name: vreplicaset-controller
name: vreplicaset-controller-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: vreplicaset-controller-role
subjects:
- kind: ServiceAccount
name: vreplicaset-controller
namespace: vreplicaset
File renamed without changes.

0 comments on commit 262c55b

Please sign in to comment.