Skip to content

Commit

Permalink
Merge pull request #1933 from openziti/linux-package-controller
Browse files Browse the repository at this point in the history
deployments alpha for Linux and Docker
  • Loading branch information
qrkourier authored Apr 15, 2024
2 parents 5dab819 + 2fbfb93 commit 480d540
Show file tree
Hide file tree
Showing 48 changed files with 1,703 additions and 86 deletions.
1 change: 1 addition & 0 deletions .github/workflows/fablab-db-creation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
build:
name: Build and Run
runs-on: ubuntu-latest
if: github.repository_owner == 'openziti'
steps:
- name: Checkout ziti
uses: actions/checkout@v4
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/publish-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,14 @@ jobs:
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
context: ${{ github.workspace }}/dist/docker-images/ziti-controller/
context: ${{ github.workspace }}/
file: ${{ github.workspace }}/dist/docker-images/ziti-controller/Dockerfile
platforms: linux/amd64,linux/arm64
tags: ${{ steps.tagprep_ctrl.outputs.DOCKER_TAGS }}
build-args: |
ZITI_CLI_TAG=${{ env.ZITI_CLI_TAG }}
ZITI_CLI_IMAGE=${{ env.ZITI_CLI_IMAGE }}
DOCKER_BUILD_DIR=./dist/docker-images/ziti-controller
push: true

- name: Set Up Container Image Tags for Router Container
Expand All @@ -116,19 +118,20 @@ jobs:
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
DOCKER_TAGS+=",${IMAGE_REPO}:latest"
fi
echo "DEBUG: DOCKER_TAGS=${DOCKER_TAGS}"
echo DOCKER_TAGS="${DOCKER_TAGS}" >> $GITHUB_OUTPUT
echo DOCKER_TAGS="${DOCKER_TAGS}" | tee -a $GITHUB_OUTPUT
- name: Build & Push Multi-Platform Router Container Image to Hub
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
context: ${{ github.workspace }}/dist/docker-images/ziti-router/
context: ${{ github.workspace }}/
file: ${{ github.workspace }}/dist/docker-images/ziti-router/Dockerfile
platforms: linux/amd64,linux/arm64
tags: ${{ steps.tagprep_router.outputs.DOCKER_TAGS }}
build-args: |
ZITI_CLI_TAG=${{ env.ZITI_CLI_TAG }}
ZITI_CLI_IMAGE=${{ env.ZITI_CLI_IMAGE }}
DOCKER_BUILD_DIR=./dist/docker-images/ziti-router
push: true

- name: Set Up Container Image Tags for Go Tunneler Container
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/publish-linux-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
matrix:
package_name:
- openziti
- openziti-controller
- openziti-router
arch:
- goreleaser: amd64
gox: amd64
Expand All @@ -40,6 +42,7 @@ jobs:
ZITI_HOMEPAGE: "https://openziti.io"
ZITI_VENDOR: "NetFoundry"
GOARCH: ${{ matrix.arch.goreleaser }}
MINIMUM_SYSTEMD_VERSION: 232
ZITI_DEB_TEST_REPO: ${{ vars.ZITI_DEB_TEST_REPO || 'zitipax-openziti-deb-test' }}
ZITI_DEB_PROD_REPO: ${{ vars.ZITI_DEB_PROD_REPO || 'zitipax-openziti-deb-stable' }}
ZITI_RPM_TEST_REPO: ${{ vars.ZITI_RPM_TEST_REPO || 'zitipax-openziti-rpm-test' }}
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Release 1.0.1

## What's New

* Deployments Alpha
* Linux packages provide systemd services for controller and router. Both depend on existing package `openziti` which provides the `ziti` command line tool.
* `openziti-controller` provides `ziti-controller.service`
* `openziti-router` provides `ziti-router.service`
* Container images for controller and router now share the bootstrapping logic with the packages, so they
support the same configuration options.

# Release 1.0.0

## About 1.0
Expand Down
4 changes: 4 additions & 0 deletions dist/cloudfront/get.openziti.io/routes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@
- get: /zdew/
raw: /openziti/desktop-edge-win/main/release-streams/
file: latest.json

- get: /dist/
raw: /openziti/ziti/{{GITHUB_SHA}}/dist/
file: /docker-images/ziti-router/compose.yml
47 changes: 47 additions & 0 deletions dist/dist-packages/linux/nfpm-openziti-controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# nfpm configuration file
#
# check https://nfpm.goreleaser.com/configuration for detailed usage
#
name: openziti-controller
arch: ${GOARCH}
platform: linux
version: ${ZITI_VERSION}
prerelease: ${ZITI_REV}
maintainer: ${ZITI_MAINTAINER}
description: >
Provides a system service for running an OpenZiti Controller
vendor: ${ZITI_VENDOR}
homepage: ${ZITI_HOMEPAGE}
license: Apache-2.0
# Contents to add to the package.
contents:
- dst: /lib/systemd/system/
src: ./dist/dist-packages/linux/openziti-controller/ziti-controller.service

- dst: /etc/systemd/system/ziti-controller.service.d/override.conf
src: ./dist/dist-packages/linux/openziti-controller/ziti-controller.service.override.conf

- dst: /opt/openziti/etc/controller
type: dir
file_info:
mode: 0755

- dst: /opt/openziti/etc/controller/
src: ./dist/dist-packages/linux/openziti-controller/service.env
type: config|noreplace

- dst: /opt/openziti/etc/controller/
src: ./dist/dist-packages/linux/openziti-controller/bootstrap.env
type: config|noreplace

- dst: /opt/openziti/etc/controller/
src: ./dist/dist-packages/linux/openziti-controller/bootstrap.bash

- dst: /opt/openziti/etc/controller/
src: ./dist/dist-packages/linux/openziti-controller/entrypoint.bash
depends:
- openziti # ziti CLI
- systemd (>= ${MINIMUM_SYSTEMD_VERSION})

scripts:
postinstall: ./dist/dist-packages/linux/openziti-controller/postinstall.bash
49 changes: 49 additions & 0 deletions dist/dist-packages/linux/nfpm-openziti-router.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# nfpm configuration file
#
# check https://nfpm.goreleaser.com/configuration for detailed usage
#
name: openziti-router
arch: ${GOARCH}
platform: linux
version: ${ZITI_VERSION}
prerelease: ${ZITI_REV}
maintainer: ${ZITI_MAINTAINER}
description: >
Provides a system service for running an OpenZiti Router
vendor: ${ZITI_VENDOR}
homepage: ${ZITI_HOMEPAGE}
license: Apache-2.0
# Contents to add to the package.
contents:
- dst: /lib/systemd/system/
src: ./dist/dist-packages/linux/openziti-router/ziti-router.service

- dst: /etc/systemd/system/ziti-router.service.d/override.conf
src: ./dist/dist-packages/linux/openziti-router/ziti-router.service.override.conf

- dst: /opt/openziti/etc/router
type: dir
file_info:
mode: 0755

- dst: /opt/openziti/etc/router/
src: ./dist/dist-packages/linux/openziti-router/service.env
type: config|noreplace

- dst: /opt/openziti/etc/router/
src: ./dist/dist-packages/linux/openziti-router/bootstrap.env
type: config|noreplace

- dst: /opt/openziti/etc/router/
src: ./dist/dist-packages/linux/openziti-router/bootstrap.bash

- dst: /opt/openziti/etc/router/
src: ./dist/dist-packages/linux/openziti-router/entrypoint.bash

scripts:
postinstall: ./dist/dist-packages/linux/openziti-router/postinstall.bash
preremove: ./dist/dist-packages/linux/openziti-router/preremove.bash

depends:
- openziti # ziti CLI
- systemd (>= ${MINIMUM_SYSTEMD_VERSION})
8 changes: 1 addition & 7 deletions dist/dist-packages/linux/nfpm-openziti.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name: openziti
arch: ${GOARCH}
platform: linux
version: ${ZITI_VERSION}
prerelease: ${ZITI_REV}
maintainer: ${ZITI_MAINTAINER}
description: >
The openziti package provides the ziti executable binary as a command line
Expand All @@ -23,10 +24,3 @@ contents:
type: symlink
replaces:
- ziti-cli

# packager-neutral scripts may be overridden by packager-specific scripts
# scripts:
# preinstall: ./scripts/preinstall.sh
# postinstall: ./scripts/postinstall.sh
# preremove: ./scripts/preremove.sh
# postremove: ./scripts/postremove.sh
Loading

0 comments on commit 480d540

Please sign in to comment.