-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactoring setup Signed-off-by: Martin Buchleitner <[email protected]> * container matrix build Signed-off-by: Martin Buchleitner <[email protected]> --------- Signed-off-by: Martin Buchleitner <[email protected]>
- Loading branch information
Showing
411 changed files
with
146 additions
and
65,928 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,92 @@ | ||
name: Infralovers Container Build - dapr-distributed-calendar | ||
|
||
on: | ||
push: | ||
branches: [ 'main' ] | ||
paths: [ 'dapr-distributed-calendar/**' ] | ||
pull_request: | ||
branches: [ 'main' ] | ||
paths: [ 'dapr-distributed-calendar/**' ] | ||
|
||
env: | ||
platforms: linux/amd64 | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
container: [ go, node, python ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Prepare tagging | ||
id: prep | ||
run: | | ||
IMAGE_NAME=$(basename ${{ github.repository }}) | ||
IMAGE_REPO=${{ github.repository_owner }} | ||
if [[ -n "${{ secrets.IMAGE_NAME }}" ]]; then | ||
IMAGE_NAME="${{ secrets.IMAGE_NAME }}" | ||
fi | ||
if [[ -n "${{ secrets.IMAGE_REPO }}" ]]; then | ||
IMAGE_REPO="${{ secrets.IMAGE_REPO }}" | ||
fi | ||
QUAY_IMAGE="quay.io/$IMAGE_REPO/$IMAGE_NAME/${{ matrix.container }}" | ||
GHCR_IMAGE="ghcr.io/${{ github.repository }}/${{ matrix.container }}" | ||
VERSION="dev" | ||
if [[ '${{ needs.prebuild.outputs.version }}' != '' ]]; then | ||
VERSION="${{ needs.prebuild.outputs.version }}" | ||
fi | ||
if [ "${{ github.event_name }}" = "schedule" ]; then | ||
VERSION="nightly" | ||
fi | ||
TAGS="${QUAY_IMAGE}:${VERSION},${GHCR_IMAGE}:${VERSION}" | ||
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then | ||
TAGS="$TAGS,${QUAY_IMAGE}:latest,${GHCR_IMAGE}:latest" | ||
fi | ||
echo "settings tag ${TAGS}" | ||
echo "tags=${TAGS}" >> $GITHUB_OUTPUT | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: ${{ env.platforms }} | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }}-${{ matrix.container }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Login to Quay | ||
if: needs.prebuild.outputs.version != '' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_USER }} | ||
password: ${{ secrets.QUAY_TOKEN }} | ||
|
||
- name: Login to GitHub Container Registry | ||
if: needs.prebuild.outputs.version != '' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.BOT_ACCESS_TOKEN }} | ||
|
||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v5 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: ./dapr-distributed-calendar/${{ matrix.container }}/ | ||
push: ${{ github.event_name != 'pull_request' && needs.prebuild.outputs.version != '' }} | ||
tags: ${{ steps.prep.outputs.tags }} | ||
platforms: ${{ env.platforms }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,14 @@ | ||
# #first stage - builder | ||
# FROM golang:1.15-buster as builder | ||
# WORKDIR /dir | ||
# COPY go_events.go . | ||
# RUN go get -d -v | ||
# RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app . | ||
# #second stage | ||
# FROM debian:buster-slim | ||
# WORKDIR /root/ | ||
# COPY --from=builder /dir/app . | ||
# EXPOSE 6000 | ||
# CMD ["./app"] | ||
|
||
# FROM golang:1.21-alpine | ||
# WORKDIR /root | ||
# COPY go_events.go . | ||
# RUN go mod init go_events | ||
# RUN go mod tidy | ||
# RUN go get -d -v | ||
# RUN go build go_events . | ||
# EXPOSE 6000 | ||
# CMD ["./go_events"] | ||
|
||
#first stage - builder | ||
#first stage - building golang artifact | ||
FROM golang:1.20.12-alpine as builder | ||
WORKDIR /dir | ||
COPY go_events.go . | ||
RUN go mod init go_events | ||
RUN go mod tidy | ||
RUN go get -d -v | ||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app . | ||
#second stage | ||
WORKDIR /src | ||
COPY . . | ||
RUN go mod download | ||
RUN CGO_ENABLED=0 go build -o app . | ||
|
||
# output container ... | ||
FROM debian:buster-slim | ||
WORKDIR /root/ | ||
COPY --from=builder /dir/app . | ||
COPY --from=builder /src/app . | ||
EXPOSE 6000 | ||
CMD ["./app"] |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module go | ||
module go_events | ||
|
||
go 1.20 | ||
|
||
require github.com/gorilla/mux v1.8.1 // indirect | ||
require github.com/gorilla/mux v1.8.1 |
Binary file not shown.
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 |
---|---|---|
@@ -1,22 +1,13 @@ | ||
# without instrumentation | ||
# FROM node:17-alpine | ||
# WORKDIR /app | ||
# COPY . . | ||
# RUN npm install | ||
# # RUN npm install cloudevents | ||
# EXPOSE 3000 | ||
# CMD [ "node", "node_controller.js" ] | ||
|
||
# with manual instrumenatation | ||
FROM node:17-alpine | ||
|
||
WORKDIR /app | ||
COPY . . | ||
RUN npm install | ||
RUN npm install @opentelemetry/api @opentelemetry/resources @opentelemetry/semantic-conventions | ||
RUN npm install @opentelemetry/sdk-node | ||
RUN npm install @opentelemetry/sdk-metrics | ||
# RUN npm install @opentelemetry/exporter-metrics-otlp-proto | ||
RUN npm install @opentelemetry/exporter-metrics-otlp-grpc | ||
# RUN npm install cloudevents | ||
RUN npm install @opentelemetry/api @opentelemetry/resources \ | ||
@opentelemetry/semantic-conventions \ | ||
@opentelemetry/sdk-node \ | ||
@opentelemetry/sdk-metrics\ | ||
@opentelemetry/exporter-metrics-otlp-grpc | ||
|
||
EXPOSE 3000 | ||
CMD [ "node", "--require", "./instrumentation.js", "node_controller.js"] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.