forked from openclarity/vmclarity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Break VMClarity control plane into microservices (openclarity#481)
* Rename backend to apiserver This PR renames the vmclarity-backend cmd and backend packages to vmclarity-apiserver and apiserver respectively in preparation to split the orchestrator and uibackend out of the backend monolith. * Break VMClarity control plane into microservices This commit breaks VMClarity backend into several new microservices: * vmclarity-apiserver - Serves the VMClarity API and connects to the DB * vmclarity-orchestrator - All the controllers for reconciling scans * vmclarity-uibackend - A UI specific API wrapper service * vmclarity-ui - An nginx server responsible for serving the UI static files An example docker compose installer is added to deploy the VMClarity stack locally. * Update AWS installer to use the microservices * Microservices AWS working * Azure microservices working * GCP microservices working * Update README after microservices * Update docker compose with all services and configurations * Code review comments addressed * More code review comments * fix docker compose grype-server
- Loading branch information
Sam Betts
authored
Aug 2, 2023
1 parent
9e1263b
commit cb5640c
Showing
82 changed files
with
2,220 additions
and
1,606 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: 'Build and Push Component' | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
dockerfile: | ||
required: true | ||
type: string | ||
description: 'Dockerfile to build and push' | ||
image_name: | ||
required: true | ||
type: string | ||
description: 'Name of the image to publish' | ||
image_tag: | ||
required: true | ||
type: string | ||
description: 'Image tag to build and push.' | ||
push: | ||
required: false | ||
type: string | ||
description: 'If set to true, push the image.' | ||
default: false | ||
upload: | ||
required: false | ||
type: string | ||
description: 'If set to true, upload the image.' | ||
default: false | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.ref }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set build output env var | ||
if: ${{ inputs.upload == 'true' }} | ||
run: | | ||
echo "OUTPUTS=type=docker,dest=/tmp/${{ inputs.image_name }}.tar" >> $GITHUB_ENV | ||
- name: Build | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
tags: ghcr.io/openclarity/${{ inputs.image_name }}:${{ inputs.image_tag }} | ||
file: ${{ inputs.dockerfile }} | ||
push: ${{ inputs.push }} | ||
outputs: "${{ env.OUTPUTS }}" | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
build-args: | | ||
VERSION=${{ inputs.image_tag }} | ||
BUILD_TIMESTAMP=${{ needs.timestamp.outputs.timestamp }} | ||
COMMIT_HASH=${{ github.sha }} | ||
- name: Upload artifact | ||
if: ${{ inputs.upload == 'true' }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ inputs.image_name }} | ||
path: /tmp/${{ inputs.image_name }}.tar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.