3 Commits

Author SHA1 Message Date
Alexandre Peixoto Ferreira
b1e04c76df Remove references to gitlab
Signed-off-by: Alexandre Peixoto Ferreira <alexandref75@gmail.com>
2022-11-07 14:24:20 -06:00
Eric Van Hensbergen
321d7b5820 Switch Docker CI from gitlab to github
Adds buildx signing and helm chart publication.

Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
2022-11-07 13:55:54 -06:00
Alexandre Peixoto Ferreira
3b4636fa30 Remove namespace so helm install it (#4)
* Remove namespace so helm install it

Signed-off-by: Alexandre Peixoto Ferreira <alexandref75@gmail.com>

* Fix nodeSelector (Bug #9027 helm)

Signed-off-by: Alexandre Peixoto Ferreira <alexandref75@gmail.com>

Signed-off-by: Alexandre Peixoto Ferreira <alexandref75@gmail.com>
2022-11-07 12:45:38 -06:00
19 changed files with 175 additions and 37 deletions

104
.github/workflows/docker-buildx.yml vendored Normal file
View File

@@ -0,0 +1,104 @@
name: Docker Image BuildX CI and Publish
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
schedule:
- cron: '19 16 * * *'
push:
branches: [ "main" ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@f3c664df7af409cb4873aa5068053ba9d61a57b6 #v2.6.0
with:
cosign-release: 'v1.13.1'
-
# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
name: Set up QEMU
uses: docker/setup-qemu-action@v2
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2.2.1
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v3
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
#- name: Build
# run: |
# docker build --platform "linux/amd64,linux/arm64" --push . --file Dockerfile --tag ${{ steps.meta.outputs.tags }} --tag ${{ steps.meta.outputs.labels }} # will run buil
# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
# repository is public to avoid leaking data. If you would like to publish
# transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
COSIGN_EXPERIMENTAL: "true"
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}

46
.github/workflows/helm.yml vendored Normal file
View File

@@ -0,0 +1,46 @@
# release.yaml
name: Release Charts
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
# Optional step if GPG signing is used
- name: Prepare GPG key
run: |
gpg_dir=.cr-gpg
mkdir "$gpg_dir"
keyring="$gpg_dir/secring.gpg"
base64 -d <<< "$GPG_KEYRING_BASE64" > "$keyring"
passphrase_file="$gpg_dir/passphrase"
echo "$GPG_PASSPHRASE" > "$passphrase_file"
echo "CR_PASSPHRASE_FILE=$passphrase_file" >> "$GITHUB_ENV"
echo "CR_KEYRING=$keyring" >> "$GITHUB_ENV"
echo "sign: true" > cr.yaml
echo "key: Smarter Project" >> cr.yaml
env:
GPG_KEYRING_BASE64: "${{ secrets.GPG_KEYRING_BASE64 }}"
GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}"
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.4.1
with:
config: cr.yaml
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

View File

@@ -1,6 +0,0 @@
include:
- project: 'ericvh/gitlab-ci-arm-template'
file: '/.gitlab-ci.yml'
variables:
CI_BUILDX_ARCHS: "linux/amd64,linux/arm64"

View File

@@ -1,8 +1,8 @@
apiVersion: v2 apiVersion: v2
name: smarter-device-manager name: smarter-device-manager
description: smarter-device-manager chart for SMARTER edge devices description: smarter-device-manager chart for SMARTER edge devices
home: https://gitlab.com/smarter-project/smarter-device-manager/helm home: https://getsmarter.io
version: 0.0.2 version: 0.0.7
appVersion: v1.20.11 appVersion: v1.20.11
kubeVersion: ">=1.16.0-0" kubeVersion: ">=1.16.0-0"
keywords: keywords:
@@ -10,12 +10,8 @@ keywords:
- device - device
- hardware - hardware
sources: sources:
- https://gitlab.com/smarter-project/smarter-device-manager - https://github.com/smarter-project/smarter-device-manager
#dependencies: icon: https://gitlab.com/uploads/-/system/group/avatar/59012546/ARM1636_Project_Logo_ST2_RGB_V1.png
# - name: smarter-common
# repository: https://gitlab.com/smarter-project/documentation
# version: 0.0.1
annotations: annotations:
artifacthub.io/changes: | artifacthub.io/changes: |
- Fix template - Fix template
@@ -26,5 +22,5 @@ annotations:
email: alexandref75@gmail.com email: alexandref75@gmail.com
artifacthub.io/prerelease: "false" artifacthub.io/prerelease: "false"
artifacthub.io/signKey: | artifacthub.io/signKey: |
fingerprint: 82AD709FEC4ECA4C84B093889BDC9DE410CFC23B fingerprint: 71EDA4E3D652DC73EB09E3A5387D298C169CF24E
url: https://keybase.io/alexandref75/pgp_keys.asc url: https://smarter-project.github.io/documentation/pgp_keys.asc

View File

@@ -6,9 +6,10 @@ For more information check out https://getsmarter.io
## TL;DR ## TL;DR
Assumes that this repository was cloned.
```console ```console
helm repo add smarter https://smarter-project.gitlab.io/documentation/charts helm install --nsmespace=smarter --create-namespace my-smarter-device-manager charts/smarter-device-manager
helm install my-smarter-device-manager smarter-device-manager --version 0.0.2
``` ```
## Overview ## Overview

View File

@@ -2,7 +2,6 @@ apiVersion: apps/v1
kind: DaemonSet kind: DaemonSet
metadata: metadata:
name: {{ .Values.application.appName }} name: {{ .Values.application.appName }}
namespace: {{ .Values.application.namespace }}
labels: labels:
name: {{ .Values.application.appName }} name: {{ .Values.application.appName }}
role: agent role: agent
@@ -20,7 +19,11 @@ spec:
node.kubernetes.io/bootstrap-checkpoint: "true" node.kubernetes.io/bootstrap-checkpoint: "true"
spec: spec:
nodeSelector: nodeSelector:
{{- toYaml .Values.configuration.nodeSelector | nindent 8 }} {{- if .Values.nodeSelector }}
{{- toYaml .Values.nodeSelector | nindent 8 }}
{{- else }}
smarter.device-manager: enabled
{{- end }}
tolerations: tolerations:
- key: "smarter.type" - key: "smarter.type"
operator: "Equal" operator: "Equal"

View File

@@ -3,7 +3,6 @@ apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: {{ .Values.application.appName }} name: {{ .Values.application.appName }}
namespace: {{ .Values.application.namespace }}
data: data:
conf.yaml: | conf.yaml: |
{{- toYaml .Values.config | nindent 4 }} {{- toYaml .Values.config | nindent 4 }}

View File

@@ -1,19 +1,14 @@
# #
application: application:
namespace: smarter
appName: smarter-device-manager appName: smarter-device-manager
image: image:
repository: registry.gitlab.com/smarter-project/smarter-device-manager repository: ghcr.io/smarter-project/smarter-device-manager
# @default -- chart.appVersion # @default -- chart.appVersion
tag: "" tag: ""
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
configuration:
nodeSelector:
smarter.device-manager: enabled
# If a specific configurations is used it can be provided by uncommenting this lines # If a specific configurations is used it can be provided by uncommenting this lines
# config: # config:
# - devicematch: ^snd$ # - devicematch: ^snd$

View File

@@ -36,7 +36,7 @@ function printHelp() {
} }
BUILD_TAG=$(date -u "+%Y%m%d%H%M%S") BUILD_TAG=$(date -u "+%Y%m%d%H%M%S")
REPOSITORY_NAME="registry.gitlab.com/smarter-project/smarter-device-manager/" REPOSITORY_NAME="ghcr.io/smarter-project/smarter-device-manager/"
IMAGE_NAME="smarter-device-manager" IMAGE_NAME="smarter-device-manager"
DIRECTORY_TO_RUN=. DIRECTORY_TO_RUN=.

View File

@@ -15,7 +15,7 @@ spec:
nodeName: smarter-jetson-xavier-4bcc2584 nodeName: smarter-jetson-xavier-4bcc2584
containers: containers:
- name: smarter-device-manager - name: smarter-device-manager
image: registry.gitlab.com/smarter-project/smarter-device-manager:v1.20.11 image: ghcr.io/smarter-project/smarter-device-manager:v1.20.11
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
securityContext: securityContext:
allowPrivilegeEscalation: false allowPrivilegeEscalation: false

View File

@@ -15,7 +15,7 @@ spec:
nodeName: <replace with node to run> nodeName: <replace with node to run>
containers: containers:
- name: smarter-device-manager - name: smarter-device-manager
image: registry.gitlab.com/smarter-project/smarter-device-manager:v1.20.11 image: ghcr.io/smarter-project/smarter-device-manager:v1.20.11
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
securityContext: securityContext:
allowPrivilegeEscalation: false allowPrivilegeEscalation: false

View File

@@ -15,7 +15,7 @@ spec:
nodeName: <replace with node to run> nodeName: <replace with node to run>
containers: containers:
- name: smarter-device-manager - name: smarter-device-manager
image: registry.gitlab.com/smarter-project/smarter-device-manager:v1.20.11 image: ghcr.io/smarter-project/smarter-device-manager:v1.20.11
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
securityContext: securityContext:
allowPrivilegeEscalation: false allowPrivilegeEscalation: false

View File

@@ -34,7 +34,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet dnsPolicy: ClusterFirstWithHostNet
containers: containers:
- name: smarter-device-manager - name: smarter-device-manager
image: registry.gitlab.com/smarter-project/smarter-device-manager:v1.20.11 image: ghcr.io/smarter-project/smarter-device-manager:v1.20.11
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
securityContext: securityContext:
allowPrivilegeEscalation: false allowPrivilegeEscalation: false

View File

@@ -34,7 +34,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet dnsPolicy: ClusterFirstWithHostNet
containers: containers:
- name: smarter-device-manager - name: smarter-device-manager
image: registry.gitlab.com/smarter-project/smarter-device-manager:v1.20.11 image: ghcr.io/smarter-project/smarter-device-manager:v1.20.11
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
securityContext: securityContext:
allowPrivilegeEscalation: false allowPrivilegeEscalation: false

View File

@@ -34,7 +34,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet dnsPolicy: ClusterFirstWithHostNet
containers: containers:
- name: smarter-device-manager - name: smarter-device-manager
image: registry.gitlab.com/smarter-project/smarter-device-manager:v1.20.11 image: ghcr.io/smarter-project/smarter-device-manager:v1.20.11
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
securityContext: securityContext:
allowPrivilegeEscalation: false allowPrivilegeEscalation: false

View File

@@ -34,7 +34,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet dnsPolicy: ClusterFirstWithHostNet
containers: containers:
- name: smarter-device-manager - name: smarter-device-manager
image: registry.gitlab.com/smarter-project/smarter-device-manager:v1.20.11 image: ghcr.io/smarter-project/smarter-device-manager:v1.20.11
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
securityContext: securityContext:
allowPrivilegeEscalation: false allowPrivilegeEscalation: false

View File

@@ -34,7 +34,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet dnsPolicy: ClusterFirstWithHostNet
containers: containers:
- name: smarter-device-manager - name: smarter-device-manager
image: registry.gitlab.com/smarter-project/smarter-device-manager:v1.20.11 image: ghcr.io/smarter-project/smarter-device-manager:v1.20.11
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
securityContext: securityContext:
allowPrivilegeEscalation: false allowPrivilegeEscalation: false

View File

@@ -34,7 +34,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet dnsPolicy: ClusterFirstWithHostNet
containers: containers:
- name: smarter-device-manager - name: smarter-device-manager
image: registry.gitlab.com/smarter-project/smarter-device-manager:v1.20.11 image: ghcr.io/smarter-project/smarter-device-manager:v1.20.11
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
securityContext: securityContext:
allowPrivilegeEscalation: false allowPrivilegeEscalation: false