This is an automated email from the ASF dual-hosted git repository.
d4rkstar pushed a commit to branch 0.9.0
in repository https://gitbox.apache.org/repos/asf/openserverless-streamer.git
The following commit(s) were added to refs/heads/0.9.0 by this push:
new bd51389 0.9.0 (#19)
bd51389 is described below
commit bd51389313ec3675bb973560d37afb4bacd47c45
Author: Michele Sciabarra <[email protected]>
AuthorDate: Mon Sep 7 13:15:35 2026 +0200
0.9.0 (#19)
* protecting main and 0.9.0
* updated task and build
* no force
* reworked credentials
* inventory of libraries
* fix license check
* fixed snapshot
---------
Co-authored-by: Trustable User <[email protected]>
Co-authored-by: Michele Sciabarra <[email protected]>
---
.env.dist | 18 +++++++
.github/workflows/check.yml | 16 +++---
.github/workflows/image.yml | 74 +++++++++++++++++++++-----
.licenserc.yaml | 1 +
Dockerfile | 5 ++
LICENSE | 124 +++++++++++++++++++++++++++++++++++++++++++-
NOTICE | 90 ++++++++++++++++++++++++++++++++
README.md | 76 ++-------------------------
Taskfile.yml | 120 +++++++++++++++++++++++++-----------------
WARN | 69 ++++++++++++++++++++++++
10 files changed, 448 insertions(+), 145 deletions(-)
diff --git a/.env.dist b/.env.dist
new file mode 100644
index 0000000..8027a41
--- /dev/null
+++ b/.env.dist
@@ -0,0 +1,18 @@
+# github user, used to derive the default local image name
+GITHUB_USER=github: put here your github user
+
+# full image name WITHOUT the tag (registry/namespace/repository).
+# Overrides the default taken from ARG STREAMER_IMAGE_DEFAULT in the
Dockerfile.
+MY_STREAMER_IMAGE=ghcr.io/${GITHUB_USER}/openserverless-streamer
+
+# for task docker-login-ghcr (github)
+GITHUB_TOKEN=
+
+# for task docker-login-dockerhub (dockerhub)
+DOCKERHUB_TOKEN=
+DOCKERHUB_USER=
+
+# used to run the streamer locally
+OW_APIHOST=
+STREAMER_ADDR=
+HTTP_SERVER_PORT=
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index f95c00e..c25901f 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -16,24 +16,24 @@
# under the License.
#
-name: Check OpenServerless Streamer
-on:
- push:
- branches: [main]
+name: Check
+on:
pull_request:
- branches: [main]
+ workflow_dispatch:
jobs:
check:
name: Check OpenServerless Streamer
runs-on: ubuntu-latest
+ permissions:
+ contents: read
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v7
with:
submodules: recursive
- - name: License
- uses: apache/skywalking-eyes@main
+ - name: License
+ uses: apache/[email protected]
- name: Assign TAG from pull request
if: ${{ github.event_name == 'pull_request' }}
run: |
diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml
index 1599ab0..c3fb422 100644
--- a/.github/workflows/image.yml
+++ b/.github/workflows/image.yml
@@ -16,31 +16,48 @@
# under the License.
#
-name: Build OpenServerless Streamer
+name: Build Image
on:
push:
tags:
- - '[0-9]*'
+ - '*.*.*.*'
branches-ignore:
- '*'
+ workflow_dispatch:
jobs:
image:
name: Build OpenServerless Streamer Image
runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ packages: write
steps:
- name: Remove unnecessary files
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v7
with:
submodules: recursive
+ # full history and tags: "task tag" replaces the existing tags
+ # and "git describe" needs them to be present
+ fetch-depth: 0
- name: Setup
run: bash .github/cisetup.sh
+ # Manual run: create a new snapshot tag on the current HEAD and push it.
+ # The push of the tag does not start another run (GITHUB_TOKEN pushes do
+ # not trigger workflows), so this same run goes on and builds it.
+ - name: Tag HEAD (manual run)
+ if: ${{ github.event_name == 'workflow_dispatch' }}
+ run: |
+ git config user.name "github-actions[bot]"
+ git config user.email
"41898282+github-actions[bot]@users.noreply.github.com"
+ task tag
+ task ci
- name: License
- uses: apache/skywalking-eyes@main
+ uses: apache/[email protected]
- name: Assign TAG from pull request
if: ${{ github.event_name == 'pull_request' }}
run: |
@@ -49,23 +66,52 @@ jobs:
if: ${{ github.event_name != 'pull_request' }}
run: |
echo "IMG_TAG=$(git describe --tags --abbrev=0)" >> "$GITHUB_ENV"
+ - name: Generate .env
+ run: |
+ OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]'
'[:lower:]')
+ if [ "$OWNER" = "apache" ]; then
+ IMAGE=$(awk -F= '/ARG STREAMER_IMAGE_DEFAULT=/ { print $2 ; exit
}' Dockerfile)
+ else
+ IMAGE="ghcr.io/$OWNER/openserverless-streamer"
+ fi
+ echo "GITHUB_USER=$OWNER" > .env
+ echo "MY_STREAMER_IMAGE=$IMAGE" >> .env
+ cat .env
- name: Unit Test
run: task test
continue-on-error: false
+ - name: Select registry
+ env:
+ DOCKERHUB_REGISTRY: ${{ secrets.DOCKERHUB_REGISTRY }}
+ run: |
+ if [ -n "$DOCKERHUB_REGISTRY" ]; then
+ REGISTRY="$DOCKERHUB_REGISTRY"
+ elif [ "${{ github.repository_owner }}" = "apache" ]; then
+ REGISTRY="docker.io"
+ else
+ REGISTRY="ghcr.io"
+ fi
+ echo "REGISTRY=$REGISTRY" >> "$GITHUB_ENV"
+ - name: Select registry credentials
+ run: |
+ if [ "${REGISTRY%%/*}" = "ghcr.io" ]; then
+ echo "REGISTRY_USER=${{ github.actor }}" >> "$GITHUB_ENV"
+ echo "REGISTRY_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> "$GITHUB_ENV"
+ else
+ echo "REGISTRY_USER=${{ secrets.DOCKERHUB_USER }}" >> "$GITHUB_ENV"
+ echo "REGISTRY_TOKEN=${{ secrets.DOCKERHUB_TOKEN }}" >>
"$GITHUB_ENV"
+ fi
- name: Registry login
- uses: docker/login-action@v3
+ uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f #
v4.6.0
with:
- registry: registry.hub.docker.com
- username: ${{ secrets.DOCKERHUB_USER }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
+ registry: ${{ env.REGISTRY }}
+ username: ${{ env.REGISTRY_USER }}
+ password: ${{ env.REGISTRY_TOKEN }}
- name: Set up QEMU
- uses: docker/setup-qemu-action@v3
+ uses:
docker/setup-qemu-action@1f40c72289eff860ee54a304f1438e3cff362e0a # v4.3.0
with:
image: tonistiigi/binfmt:qemu-v7.0.0-28
- name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
+ uses:
docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
- name: Image
- env:
- REGISTRY: apache
- NAMESPACE: apache
- run: task buildx PUSH=1 TAG=$IMG_TAG
\ No newline at end of file
+ run: task buildx PUSH=1 STREAMER_TAG=$IMG_TAG
\ No newline at end of file
diff --git a/.licenserc.yaml b/.licenserc.yaml
index eaabe30..c171922 100644
--- a/.licenserc.yaml
+++ b/.licenserc.yaml
@@ -47,3 +47,4 @@ header:
- 'customkitd.toml'
- 'runtimes.json'
- 'runtimes.json.tpl'
+ - WARN
diff --git a/Dockerfile b/Dockerfile
index e468671..cfbd2ce 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -22,6 +22,11 @@ ENV CGO_ENABLED=0 GOOS=linux
RUN go build -ldflags="-s -w" -o streamer
FROM scratch
+ARG STREAMER_IMAGE_DEFAULT=docker.io/apache/openserverless-streamer
+ARG STREAMER_TAG_DEFAULT=latest
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /src/streamer /streamer
+# Apache release metadata (see DISCLAIMER, LICENSE, NOTICE, WARN)
+COPY DISCLAIMER LICENSE NOTICE /
+
ENTRYPOINT ["/streamer"]
diff --git a/LICENSE b/LICENSE
index dc2c22e..90053c9 100644
--- a/LICENSE
+++ b/LICENSE
@@ -215,4 +215,126 @@ Spray Caching 1.3.4 (io.spray:spray-caching_2.11:1.3.4 -
http://spray.io/documen
This product bundles the files gradlew and gradlew.bat from Gradle v5.5
which are distributed under the Apache License, Version 2.0.
-For details see ./gradlew and ./gradlew.bat.
\ No newline at end of file
+For details see ./gradlew and ./gradlew.bat.
+
+
+==============================================================================
+BEGIN BUNDLED THIRD-PARTY SOFTWARE INVENTORY (container image)
+==============================================================================
+
+==============================================================================
+LICENSES OF BUNDLED THIRD-PARTY SOFTWARE
+Container image: apache/openserverless-streamer
+==============================================================================
+
+Apache OpenServerless itself is licensed under the Apache License,
+Version 2.0, reproduced above. The container image built from the
+Dockerfile beside this file additionally bundles the third-party
+components listed below, each under its own license.
+
+Refer to https://www.apache.org/legal/resolved.html for the ASF
+classification of these licenses. Components that are NOT compatible
+with the Apache License 2.0 are enumerated in the WARN file.
+
+------------------------------------------------------------------------------
+Summary by license
+------------------------------------------------------------------------------
+
+Apache-2.0
+ github.com/apache/openwhisk-client-go (v0.0.0-20241028140229-bb8408824b9b)
+ github.com/cloudfoundry/jibber_jabber (v0.0.0-20151120183258-bcc4c8345a21)
+ github.com/pelletier/go-toml (v1.9.5)
+
+Apache-2.0 AND MIT
+ gopkg.in/yaml.v2 (v2.4.0)
+ gopkg.in/yaml.v3 (v3.0.1)
+
+BSD-2-Clause
+ gopkg.in/check.v1 (v0.0.0-20161208181325-20d25e280405)
+
+BSD-3-Clause
+ github.com/fsnotify/fsnotify (v1.6.0)
+ github.com/google/go-cmp (v0.5.2)
+ github.com/google/go-querystring (v1.1.0)
+ github.com/pmezard/go-difflib (v1.0.1-0.20181226105442-5d4384ee4fb2)
+ golang.org/x/net (v0.38.0)
+ golang.org/x/sys (v0.31.0)
+ golang.org/x/text (v0.23.0)
+ gopkg.in/tomb.v1 (v1.0.0-20141024135613-dd632973f1e7)
+
+ISC
+ github.com/davecgh/go-spew (v1.1.2-0.20180830191138-d8f796af33cc)
+
+MIT
+ github.com/fatih/color (v1.17.0)
+ github.com/hokaccha/go-prettyjson (v0.0.0-20211117102719-0474bc63780f)
+ github.com/mattn/go-colorable (v0.1.13)
+ github.com/mattn/go-isatty (v0.0.20)
+ github.com/nicksnyder/go-i18n (v1.10.3)
+ github.com/nxadm/tail (v1.4.11)
+ github.com/onsi/ginkgo (v1.15.0)
+ github.com/onsi/gomega (v1.10.5)
+ github.com/stretchr/testify (v1.9.0)
+
+MPL-2.0
+ CA certificates bundle ((Alpine ca-certificates))
+
+------------------------------------------------------------------------------
+Detail by component
+------------------------------------------------------------------------------
+
+Go module dependencies (src/go.mod, src/go.sum)
+-----------------------------------------------
+ github.com/apache/openwhisk-client-go (v0.0.0-20241028140229-bb8408824b9b)
-- Apache-2.0
+ Apache OpenWhisk.
+ github.com/stretchr/testify (v1.9.0) -- MIT
+ Test-only dependency.
+ github.com/cloudfoundry/jibber_jabber (v0.0.0-20151120183258-bcc4c8345a21)
-- Apache-2.0
+ github.com/davecgh/go-spew (v1.1.2-0.20180830191138-d8f796af33cc) -- ISC
+ github.com/fatih/color (v1.17.0) -- MIT
+ github.com/google/go-querystring (v1.1.0) -- BSD-3-Clause
+ github.com/hokaccha/go-prettyjson (v0.0.0-20211117102719-0474bc63780f) -- MIT
+ github.com/mattn/go-colorable (v0.1.13) -- MIT
+ github.com/mattn/go-isatty (v0.0.20) -- MIT
+ github.com/nicksnyder/go-i18n (v1.10.3) -- MIT
+ github.com/nxadm/tail (v1.4.11) -- MIT
+ github.com/pelletier/go-toml (v1.9.5) -- Apache-2.0
+ github.com/pmezard/go-difflib (v1.0.1-0.20181226105442-5d4384ee4fb2) --
BSD-3-Clause
+ golang.org/x/net (v0.38.0) -- BSD-3-Clause
+ golang.org/x/sys (v0.31.0) -- BSD-3-Clause
+ golang.org/x/text (v0.23.0) -- BSD-3-Clause
+ gopkg.in/yaml.v2 (v2.4.0) -- Apache-2.0 AND MIT
+ gopkg.in/yaml.v3 (v3.0.1) -- Apache-2.0 AND MIT
+ github.com/onsi/ginkgo (v1.15.0) -- MIT
+ Test-only, transitive.
+ github.com/onsi/gomega (v1.10.5) -- MIT
+ Test-only, transitive.
+ github.com/fsnotify/fsnotify (v1.6.0) -- BSD-3-Clause
+ Transitive.
+ github.com/google/go-cmp (v0.5.2) -- BSD-3-Clause
+ Test-only, transitive.
+ gopkg.in/check.v1 (v0.0.0-20161208181325-20d25e280405) -- BSD-2-Clause
+ Test-only, transitive.
+ gopkg.in/tomb.v1 (v1.0.0-20141024135613-dd632973f1e7) -- BSD-3-Clause
+ Transitive.
+ CA certificates bundle ((Alpine ca-certificates)) -- MPL-2.0
+ Category B: copied unmodified from the builder stage.
+
+------------------------------------------------------------------------------
+Full license texts
+------------------------------------------------------------------------------
+
+The complete text of the Apache License 2.0 is reproduced at the top of
+this file. The complete texts of the other licenses referenced above are
+distributed with each component inside the container image, in the
+package metadata directories of the respective package manager:
+
+ * Python packages: <site-packages>/<dist>.dist-info/ (LICENSE, METADATA)
+ * Node.js packages: /node_modules/<pkg>/LICENSE
+ * PHP packages: /phpAction/composer/vendor/<pkg>/LICENSE
+ * Go modules: vendored module sources / pkg.go.dev
+ * Debian packages: /usr/share/doc/<pkg>/copyright
+
+==============================================================================
+END BUNDLED THIRD-PARTY SOFTWARE INVENTORY
+==============================================================================
diff --git a/NOTICE b/NOTICE
index 9b09468..ea92cf4 100644
--- a/NOTICE
+++ b/NOTICE
@@ -4,3 +4,93 @@ Copyright 2024 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
+
+==============================================================================
+BEGIN BUNDLED THIRD-PARTY SOFTWARE INVENTORY (container image)
+==============================================================================
+
+------------------------------------------------------------------------------
+Container image: apache/openserverless-streamer
+------------------------------------------------------------------------------
+
+This image bundles third-party software. The components below are
+redistributed under the licenses recorded in the LICENSE file that
+accompanies this NOTICE. Components flagged '*** SEE WARN ***' are
+listed in the WARN file as incompatible with the Apache License 2.0.
+
+Go module dependencies (src/go.mod, src/go.sum)
+-----------------------------------------------
+ * github.com/apache/openwhisk-client-go (v0.0.0-20241028140229-bb8408824b9b)
+ License: Apache-2.0
+ Apache OpenWhisk.
+ * github.com/stretchr/testify (v1.9.0)
+ License: MIT
+ Test-only dependency.
+ * github.com/cloudfoundry/jibber_jabber (v0.0.0-20151120183258-bcc4c8345a21)
+ License: Apache-2.0
+ * github.com/davecgh/go-spew (v1.1.2-0.20180830191138-d8f796af33cc)
+ License: ISC
+ * github.com/fatih/color (v1.17.0)
+ License: MIT
+ * github.com/google/go-querystring (v1.1.0)
+ License: BSD-3-Clause
+ * github.com/hokaccha/go-prettyjson (v0.0.0-20211117102719-0474bc63780f)
+ License: MIT
+ * github.com/mattn/go-colorable (v0.1.13)
+ License: MIT
+ * github.com/mattn/go-isatty (v0.0.20)
+ License: MIT
+ * github.com/nicksnyder/go-i18n (v1.10.3)
+ License: MIT
+ * github.com/nxadm/tail (v1.4.11)
+ License: MIT
+ * github.com/pelletier/go-toml (v1.9.5)
+ License: Apache-2.0
+ * github.com/pmezard/go-difflib (v1.0.1-0.20181226105442-5d4384ee4fb2)
+ License: BSD-3-Clause
+ * golang.org/x/net (v0.38.0)
+ License: BSD-3-Clause
+ * golang.org/x/sys (v0.31.0)
+ License: BSD-3-Clause
+ * golang.org/x/text (v0.23.0)
+ License: BSD-3-Clause
+ * gopkg.in/yaml.v2 (v2.4.0)
+ License: Apache-2.0 AND MIT
+ * gopkg.in/yaml.v3 (v3.0.1)
+ License: Apache-2.0 AND MIT
+ * github.com/onsi/ginkgo (v1.15.0)
+ License: MIT
+ Test-only, transitive.
+ * github.com/onsi/gomega (v1.10.5)
+ License: MIT
+ Test-only, transitive.
+ * github.com/fsnotify/fsnotify (v1.6.0)
+ License: BSD-3-Clause
+ Transitive.
+ * github.com/google/go-cmp (v0.5.2)
+ License: BSD-3-Clause
+ Test-only, transitive.
+ * gopkg.in/check.v1 (v0.0.0-20161208181325-20d25e280405)
+ License: BSD-2-Clause
+ Test-only, transitive.
+ * gopkg.in/tomb.v1 (v1.0.0-20141024135613-dd632973f1e7)
+ License: BSD-3-Clause
+ Transitive.
+ * CA certificates bundle ((Alpine ca-certificates))
+ License: MPL-2.0
+ Category B: copied unmodified from the builder stage.
+
+------------------------------------------------------------------------------
+Attribution required by bundled components
+------------------------------------------------------------------------------
+
+This product includes software developed by the Apache Software
+Foundation (http://www.apache.org/), including Apache OpenWhisk
+components and Apache-2.0 licensed libraries listed above.
+
+This product includes software developed by third parties under the
+MIT, BSD, ISC, PSF, MPL-2.0 and other licenses, as recorded in LICENSE.
+
+==============================================================================
+END BUNDLED THIRD-PARTY SOFTWARE INVENTORY
+==============================================================================
diff --git a/README.md b/README.md
index c5a80a3..151ae25 100644
--- a/README.md
+++ b/README.md
@@ -61,77 +61,7 @@ given namespace, default package, and action name.
- `GET/POST /web/{namespace}/{package}/{action}`: to invoke an OpenWhisk web
action on the given namespace, custom package, and action name.
-## Tasks
-
-Taskfile supports the following tasks:
-
-```yaml
-* build: Build the streamer binary locally. This will create a
binary named streamer in the current directory.
-* buildx: Build the docker image using buildx. Set PUSH=1 to push
the image to the registry.
-* clean: Clean up the build artifacts. This will remove the
streamer binary and clean the go cache.
-* docker-login: Login to the docker registry. Set REGISTRY=ghcr or
REGISTRY=dockerhub in .env to use the respective registry.
-* image-tag: Create a new tag for the current git commit.
-* run: Run the streamer binary locally, using configuration
from .env file
-* test: Run the tests in the src directory.
-```
-
-## Build and push
-
-### Private registry or local image
-
-To build an image and push it on a private repository, firstly choose which
-registry you want to use.
-Tasks support is for Github (ghcr) and Dockerhub (dockerhub).
-So copy the `.env.example` to `.env` and configure the required variables for
-authentication and set the `REGISTRY` and `NAMESPACE` accordly.
-
-Now create a new tag
-
-```bash
-$ task image-tag
-```
-You should see an output like this:
-
-```bash
-Deleted tag '0.1.0-rc1-incubating.2504260711' (was 5a2f6d3)
-0.1.0-rc1-incubating.2504260905
-```
-
-:bulb: **NOTE** If you leave unset `REGISTRY` a local
`openserverless-streamer`
-image will be built, using the generated tag.
-
-If you setup the `REGISTRY` and `NAMESPACE`, you can give a:
-
-```bash
-$ task docker-login
-```
-
-To build:
-
-```bash
-$ task buildx
-```
-
-To build and push
-
-```bash
-$ task buildx PUSH=1
-```
-
-### Apache repository
-To build an official Apache OpensSrverless Streamer image, you
-need to be a committer.
-
-If you have the proper permissions, the build process will start pushing a
-new tag to apache/openserverless-streamer repository.
-So, for example, if your tag is `0.1.0-rc1-incubating.2504260905` and your
-git remote is `apache`
-
-```bash
-$ git push apache 0.1.0-rc1-incubating.2504260905
-```
-
-This will trigger the build workflow, and the process will be visible at
-https://github.com/apache/openserverless-streamer/actions
-
+## Building
+Check the
[BUILD.md](https://github.com/apache/openserverless/blob/main/BUILD.md)
+in the [apache/openserverless](https://github.com/apache/openserverless)
repository.
diff --git a/Taskfile.yml b/Taskfile.yml
index b6ae333..0798cd5 100644
--- a/Taskfile.yml
+++ b/Taskfile.yml
@@ -18,88 +18,104 @@
version: "3"
vars:
- BASETAG: 0.1.0-incubating
+ BASETAG: 0.9.0-incubating
+ SUFFIX: "-snapshot"
COMMIT_ID:
sh: git rev-parse --short HEAD
+ # taken from the tag - overridable with STREAMER_TAG env var
TAG:
- sh: git describe --tags --abbrev=0 2>/dev/null || echo latest
+ sh: echo "${STREAMER_TAG:-$(git describe --tags --abbrev=0 2>/dev/null ||
git rev-parse --short HEAD)}"
+ # taken from the Dockerfile - overridable with MY_STREAMER_IMAGE env var
+ STREAMER_IMAGE:
+ sh: echo "${MY_STREAMER_IMAGE:-$(awk -F= '/ARG STREAMER_IMAGE_DEFAULT=/ {
print $2 ; exit }' Dockerfile)}"
dotenv:
- .env
tasks:
- docker-login-ghcr: >
+ docker-login-ghcr:
silent: true
- cmds:
+ cmds:
- |
echo "Logging in to ghcr.io as $GITHUB_USER"
echo $GITHUB_TOKEN | docker login ghcr.io -u $GITHUB_USER
--password-stdin
-
+
docker-login-dockerhub:
silent: true
- cmds:
+ cmds:
- |
- echo "Logging in to dockerhub as $DOCKERHUB_USER"
- echo $DOCKERHUB_TOKEN | docker login -u $DOCKERHUB_USER
--password-stdin
+ echo "Logging in to docker.io as $DOCKERHUB_USER"
+ echo $DOCKERHUB_TOKEN | docker login docker.io -u $DOCKERHUB_USER
--password-stdin
docker-login:
desc: |
- Login to the docker registry. Set REGISTRY=ghcr or REGISTRY=dockerhub in
.env
- to use the respective registry.
+ Login to the registry the image name points to: docker.io for apache
images,
+ ghcr.io otherwise.
silent: true
cmds:
- |
- if [ -z "$REGISTRY" ]; then
- echo "Error: REGISTRY variable is not set in .env"
- exit 1
- fi
- task docker-login-$REGISTRY
-
- base-image-name:
+ IMG="${MY_STREAMER_IMAGE:-{{.STREAMER_IMAGE}}}"
+ case "$IMG" in
+ ghcr.io/*) task docker-login-ghcr ;;
+ *) task docker-login-dockerhub ;;
+ esac
+
+ image:
+ desc: |
+ Print the image name that would be built.
silent: true
cmds:
- - |
- if [ -n "$REGISTRY" ] && [ -z "$NAMESPACE" ]; then
- echo "Error: NAMESPACE variable is not set in .env"
- exit 1
- fi
- if [ "$REGISTRY" = "ghcr" ]; then
- echo "ghcr.io/$NAMESPACE/openserverless-streamer"
- elif [ "$REGISTRY" = "dockerhub" ]; then
- echo "docker.io/$NAMESPACE/openserverless-streamer"
- elif [ "$REGISTRY" = "apache" ]; then
- echo "registry.hub.docker.com/apache/openserverless-streamer"
- else
- echo "openserverless-streamer"
- fi
+ - echo "Streamer=${MY_STREAMER_IMAGE:-{{.STREAMER_IMAGE}}}:{{.TAG}}"
+ # deprecated - use task tag
image-tag:
+ desc: "[deprecated] use task tag"
+ silent: true
+ cmds:
+ - 'echo "deprecated, use task tag"'
+
+ tag:
+ desc: |
+ Create a new snapshot tag for the current git commit.
+ NOTE: this deletes the existing local tags first - snapshot tags are
disposable.
silent: true
+ vars:
+ TS:
+ sh: date '+%y %m %d %H %M' | awk '{printf "%s%s%02d%s%02d\n", $1,
substr("abcdefghijkl",$2+0,1), $3, substr("abcdefghijklmnopqrstuvwx",$4+1,1),
$5}'
+ cmds:
+ - git tag -d $(git tag) 2>/dev/null || true
+ - |
+ TAG="{{.BASETAG}}.{{.TS}}{{.SUFFIX}}"
+ git tag -f $TAG
+ echo New tag $TAG
+
+ ci:
desc: |
- Create a new tag for the current git commit.
+ Push the tags, starting the GitHub Actions build on the repo that
received them.
+ This does not build anything locally.
cmds:
- - git tag -d $(git tag)
- - git tag -f {{.BASETAG}}.$(date +%y%m%d%H%M)
- - env PAGER= git tag
-
+ - git push --tags
+
buildx:
desc: |
Build the docker image using buildx. Set PUSH=1 to push the image to the
registry.
silent: true
cmds:
- |
- BASEIMG=$(task base-image-name)
- IMG="$BASEIMG:{{.TAG}}"
+ IMG="${MY_STREAMER_IMAGE:-{{.STREAMER_IMAGE}}}:{{.TAG}}"
if [ -n "{{.PUSH}}" ]; then
- if [ -z "$REGISTRY" ]; then
- echo "Error: REGISTRY variable must be set in .env to push the
image"
- exit 1
- fi
- {{.DRY}} docker buildx build -t $IMG --platform
linux/amd64,linux/arm64 . --push
+ {{.DRY}} docker buildx build -t "$IMG" \
+ --build-arg
STREAMER_IMAGE_DEFAULT="${MY_STREAMER_IMAGE:-{{.STREAMER_IMAGE}}}" \
+ --build-arg STREAMER_TAG_DEFAULT="{{.TAG}}" \
+ --platform linux/amd64,linux/arm64 . --push
else
- {{.DRY}} docker buildx build -t $IMG . --load
+ {{.DRY}} docker buildx build -t "$IMG" \
+ --build-arg
STREAMER_IMAGE_DEFAULT="${MY_STREAMER_IMAGE:-{{.STREAMER_IMAGE}}}" \
+ --build-arg STREAMER_TAG_DEFAULT="{{.TAG}}" \
+ . --load
fi
+ echo "Built $IMG"
test:
desc: |
@@ -109,8 +125,14 @@ tasks:
cd src
go test -v ./...
cd ../
-
+
build:
+ desc: |
+ Build the docker image locally and load it into the local docker daemon.
+ cmds:
+ - task: buildx
+
+ build-binary:
desc: |
Build the streamer binary locally. This will create a binary named
streamer in the current directory.
silent: true
@@ -119,7 +141,7 @@ tasks:
rm -f streamer
cd src
echo "Building streamer binary..."
- if test -n "{{.OPTIMIZE}}"
+ if test -n "{{.OPTIMIZE}}"
then {{.DRY}} CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o
../streamer
else {{.DRY}} go build -o ../streamer
fi
@@ -130,11 +152,11 @@ tasks:
exit 1
fi
cd ../
-
+
clean:
desc: |
Clean up the build artifacts. This will remove the streamer binary and
clean the go cache.
- cmds:
+ cmds:
- |
rm -f streamer || true
cd src
@@ -146,6 +168,6 @@ tasks:
desc: |
Run the streamer binary locally, using configuration from .env file
cmds:
- - task: build
+ - task: build-binary
- ./streamer
diff --git a/WARN b/WARN
new file mode 100644
index 0000000..909f1e5
--- /dev/null
+++ b/WARN
@@ -0,0 +1,69 @@
+==============================================================================
+WARN -- Apache License 2.0 incompatibilities
+Container image: apache/openserverless-streamer
+==============================================================================
+
+This file lists third-party components bundled by the Dockerfile beside
+it whose licenses are NOT compatible with the Apache License, Version 2.0,
+together with components that require special handling.
+
+Classification follows the ASF third-party licensing policy:
+
+ https://www.apache.org/legal/resolved.html
+
+ Category A Apache-2.0 compatible. May be included in a release.
+ Category B May be included in BINARY form only, unmodified and as a
+ separate file, with the reciprocal license disclosed.
+ Category X MUST NOT be included in an Apache release artifact.
+
+IMPORTANT SCOPE NOTE
+------------------------------------------------------------------------------
+The Apache release artifact for OpenServerless is the SOURCE distribution,
+which contains this Dockerfile and the files beside it -- all Apache-2.0
+licensed. The published container image is a CONVENIENCE BINARY assembled
+at build time from third-party base images and package repositories.
+Category X components inherited from a base operating system image are
+disclosed below but are not redistributed by the ASF in source form.
+Category X components that this Dockerfile ADDS on purpose must be removed.
+
+
+==============================================================================
+CATEGORY X (as bundled)
+==============================================================================
+
+ Component : Debian/Ubuntu/Alpine base image userland
+ License : mixed, incl. GPL-2.0/GPL-3.0
+ Category : X (as bundled)
+ Action :
+ The base image contains GPL-licensed operating-system components. The
Apache release
+ artifact is the SOURCE (this Dockerfile and the files beside it); the
published
+ container image is a convenience binary assembled from third-party base
images.
+ No action required beyond this disclosure.
+
+
+==============================================================================
+CATEGORY B
+==============================================================================
+
+ Component : certifi / ca-certificates
+ License : MPL-2.0
+ Category : B
+ Action :
+ Category B: MPL-2.0 may be included in binary form only, unmodified and
as a
+ separate file. That is satisfied here. No action required.
+
+
+==============================================================================
+SUMMARY OF REQUIRED REMOVALS (Category X added by this Dockerfile)
+==============================================================================
+
+ None. This image adds no Category X component of its own.
+
+==============================================================================
+ADDITIONAL NOTES
+==============================================================================
+
+The final stage is FROM scratch: it contains only the statically linked
+streamer binary and a CA certificate bundle. No operating-system userland
+is redistributed in this image, so no GPL component is present.
+