Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 4.x #1432

Merged
merged 59 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
345ca8c
Convert shell plugin to internal plugin (#975)
Jul 22, 2022
54ab0c6
Remove old UI (#984)
Jul 22, 2022
376a820
Merge branch 'master' into 4.x
Dec 9, 2023
4dcd2c7
Shell command needs proper usage and desc to be valid
Dec 9, 2023
055f0e1
Release a light image tag (#988)
vcastellm Dec 12, 2023
7af72c3
Upgrade react admin to v4 (#1436)
vcastellm Feb 3, 2024
2f40b60
Use exponential backoff for retries (#1433)
vcastellm Feb 3, 2024
1c45fdf
Handle ip changes (#1446)
ivan-kripakov-m10 Feb 3, 2024
7ee3ab6
Remove shell bin building because it's builtin
vcastellm Feb 3, 2024
1377bcd
Fix windows build
vcastellm Feb 4, 2024
7a2d490
Clean up space in CI
vcastellm Feb 4, 2024
c35d31e
Move config init to agent command (#1465)
vcastellm Feb 6, 2024
665c865
Fix disabled (#1467)
vcastellm Feb 8, 2024
41c82f3
Docs
vcastellm Feb 8, 2024
586f72d
Bump module to v4 (#1470)
vcastellm Feb 10, 2024
f05aefe
Embed http plugin (#1471)
vcastellm Feb 10, 2024
03fb813
Merge branch 'main' into 4.x
vcastellm Feb 10, 2024
aec162a
Show all Job fields
vcastellm Feb 11, 2024
86ce37f
Refactor buttons for admin v4
vcastellm Feb 11, 2024
9a1bc04
Build UI
vcastellm Feb 11, 2024
fccc1fb
4.0 Banner and blog post
vcastellm Feb 11, 2024
f7eaff0
Build with docker node
vcastellm Feb 11, 2024
37fd38b
Docs v4 (#1473)
vcastellm Feb 11, 2024
203e31d
Reuse http clients with the same configuration (#1474)
vcastellm Feb 12, 2024
b71cf98
Update OpenAPI spec to v3.1.0 and add ACLs spec
vcastellm Feb 25, 2024
b7235ee
Merge branch '4.x' of github.com:distribworks/dkron into 4.x
vcastellm Feb 25, 2024
794a178
Refactor location of types as they not only belong to plugins, but us…
vcastellm Feb 25, 2024
a0717ae
Move member type to types
vcastellm Feb 25, 2024
6426308
Generate client
vcastellm Feb 25, 2024
4fcd8f7
protoc line
vcastellm Feb 25, 2024
aae95b9
Extend protobuf defs for ACLs
vcastellm Mar 24, 2024
b1ce3da
Token fields
vcastellm Mar 24, 2024
fbac360
Typo
vcastellm Mar 31, 2024
ede6770
Replace deprecated protobuf package
vcastellm Mar 31, 2024
fb49e86
Fix import
vcastellm Mar 31, 2024
e2a86ac
Token Type
vcastellm Mar 31, 2024
b2d5928
Use accessor for tokens
vcastellm Mar 31, 2024
d46947b
The policy should be just a ref
vcastellm Mar 31, 2024
a2face7
Consider existing Job
vcastellm Apr 1, 2024
5ffe0ec
UI fs as param
vcastellm Apr 1, 2024
8324be2
Minor improvement in RabbitMQ executor (#1500)
ivan-kripakov-m10 Jun 5, 2024
3a2d525
Merge branch 'main' into 4.x
vcastellm Jun 30, 2024
cf7f071
nice and forkable goreleaser (#1584)
fopina Sep 15, 2024
5597995
Merge branch 'main' into 4.x
vcastellm Sep 15, 2024
cf6c471
fix: merge
vcastellm Sep 15, 2024
45cbc4f
chore: bump infra
vcastellm Sep 15, 2024
ebcb366
add support for hash scheduling (#1260)
fopina Sep 16, 2024
3194c45
refactor: no edit owner
vcastellm Sep 29, 2024
0f79eec
feat: Login form and admin update (#1589)
vcastellm Oct 2, 2024
b83ed25
fix: fix ui and ownerships (#1591)
vcastellm Oct 6, 2024
cdf7323
ci: bump outdated actions
vcastellm Oct 6, 2024
ec74f7a
ci: fix gorelease
vcastellm Oct 6, 2024
cda5e30
ci: fix gorelease
vcastellm Oct 6, 2024
a9c0b44
doc: acls
vcastellm Oct 6, 2024
8e868c5
doc: acl
vcastellm Oct 6, 2024
1a9b3d8
doc: update pro cli docs
vcastellm Oct 6, 2024
d82e9b7
doc: add missing link
vcastellm Oct 6, 2024
a651a3f
Merge remote-tracking branch 'origin' into 4.x
vcastellm Oct 6, 2024
9820786
chore: go mod
vcastellm Oct 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
steps:

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.21
go-version: 1.22
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Get dependencies
run: go get -v -t -d ./...
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Prepare
id: prepare
run: |
TAG=${GITHUB_REF#refs/tags/}
echo ::set-output name=tag_name::${TAG}
echo "tag_name=${TAG}" >> $GITHUB_OUTPUT

- name: Clean up
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3

- name: Run GoReleaser
run: |
Expand Down
91 changes: 62 additions & 29 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ project_name: dkron
release:
prerelease: auto

env:
- IMAGE_PREFIX={{ if index .Env "IMAGE_PREFIX" }}{{ .Env.IMAGE_PREFIX }}{{ else }}dkron{{ end }}

builds:
- &xbuild
main: ./builtin/bins/dkron-executor-http/
id: dkron-executor-http
binary: dkron-executor-http
main: .
id: dkron
binary: dkron
env:
- CGO_ENABLED=0
goos:
Expand All @@ -22,12 +25,7 @@ builds:
goarm:
- '7'
ldflags:
- -s -w

- <<: *xbuild
main: ./builtin/bins/dkron-executor-shell/
id: dkron-executor-shell
binary: dkron-executor-shell
- -s -w -X github.com/distribworks/dkron/v4/dkron.Version={{.Version}} -X github.com/distribworks/dkron/v4/dkron.Codename=Abaniko

- <<: *xbuild
main: ./builtin/bins/dkron-executor-rabbitmq/
Expand Down Expand Up @@ -74,13 +72,6 @@ builds:
id: dkron-processor-fluent
binary: dkron-processor-fluent

- <<: *xbuild
main: .
id: dkron
binary: dkron
ldflags:
- -s -w -X github.com/distribworks/dkron/v3/dkron.Version={{.Version}} -X github.com/distribworks/dkron/v3/dkron.Codename=Abaniko

nfpms:
-
vendor: Distributed Works
Expand Down Expand Up @@ -119,15 +110,13 @@ snapshot:

dockers:
- image_templates:
- dkron/{{ .ProjectName }}:{{ .Version }}-amd64
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-amd64"
dockerfile: Dockerfile.release
use: buildx
goos: linux
goarch: amd64
ids: &docker-ids
- dkron
- dkron-executor-http
- dkron-executor-shell
- dkron-executor-rabbitmq
- dkron-executor-nats
- dkron-executor-kafka
Expand All @@ -141,7 +130,7 @@ dockers:
- --platform=linux/amd64

- image_templates:
- dkron/{{ .ProjectName }}:{{ .Version }}-arm64
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-arm64"
dockerfile: Dockerfile.release
use: buildx
goos: linux
Expand All @@ -151,7 +140,39 @@ dockers:
- --platform=linux/arm64/v8

- image_templates:
- dkron/{{ .ProjectName }}:{{ .Version }}-armv7
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-armv7"
dockerfile: Dockerfile.release
use: buildx
goos: linux
goarch: arm
goarm: '7'
ids: *docker-ids
build_flag_templates:
- --platform=linux/arm/v7

- image_templates:
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-light-amd64"
dockerfile: Dockerfile.release
use: buildx
goos: linux
goarch: amd64
ids: &docker-ids
- dkron
build_flag_templates:
- --platform=linux/amd64

- image_templates:
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-light-arm64"
dockerfile: Dockerfile.release
use: buildx
goos: linux
goarch: arm64
ids: *docker-ids
build_flag_templates:
- --platform=linux/arm64/v8

- image_templates:
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-light-armv7"
dockerfile: Dockerfile.release
use: buildx
goos: linux
Expand All @@ -162,17 +183,29 @@ dockers:
- --platform=linux/arm/v7

docker_manifests:
- name_template: dkron/{{ .ProjectName }}:{{ .Version }}
- name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}"
image_templates:
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-amd64"
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-arm64"
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-armv7"

- name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:latest"
image_templates:
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-amd64"
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-arm64"
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-armv7"

- name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-light"
image_templates:
- dkron/{{ .ProjectName }}:{{ .Version }}-amd64
- dkron/{{ .ProjectName }}:{{ .Version }}-arm64
- dkron/{{ .ProjectName }}:{{ .Version }}-armv7
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-light-amd64"
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-light-arm64"
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-light-armv7"

- name_template: dkron/{{ .ProjectName }}:latest
- name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:light"
image_templates:
- dkron/{{ .ProjectName }}:{{ .Version }}-amd64
- dkron/{{ .ProjectName }}:{{ .Version }}-arm64
- dkron/{{ .ProjectName }}:{{ .Version }}-armv7
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-light-amd64"
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-light-arm64"
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-light-armv7"

changelog:
sort: asc
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM golang:1.18
LABEL maintainer="Victor Castell <[email protected]>"
FROM golang:1.22
LABEL maintainer="Victor Castell <[email protected]>"

EXPOSE 8080 8946

Expand Down
15 changes: 15 additions & 0 deletions Dockerfile.light.hub
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM alpine:3.20
LABEL maintainer="Victor Castell <[email protected]>"

RUN set -x \
&& buildDeps='bash ca-certificates openssl tzdata' \
&& apk add --no-cache --update $buildDeps

EXPOSE 8080 8946

ENV SHELL /bin/bash
COPY dkron /usr/local/bin/

ENTRYPOINT ["/usr/local/bin/dkron"]

CMD ["--help"]
4 changes: 2 additions & 2 deletions Dockerfile.release
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM alpine:3.15
LABEL maintainer="Victor Castell <[email protected]>"
FROM alpine:3.20
LABEL maintainer="Victor Castell <[email protected]>"

RUN set -x \
&& buildDeps='bash ca-certificates openssl tzdata' \
Expand Down
38 changes: 24 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $(LINUX_PKGS):
fury push --as distribworks $@

PACKAGE_NAME := github.com/distribworks/dkron
GOLANG_CROSS_VERSION ?= v1.21.5
GOLANG_CROSS_VERSION ?= v1.22

.PHONY: release-dry-run
release-dry-run:
Expand All @@ -22,7 +22,7 @@ release-dry-run:
-v `pwd`:/go/src/$(PACKAGE_NAME) \
-w /go/src/$(PACKAGE_NAME) \
goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
--rm-dist --skip-validate --skip-publish --timeout=1h --parallelism=1
--clean --skip=validate,publish --timeout=1h --parallelism=1

.PHONY: release
release:
Expand All @@ -39,7 +39,7 @@ release:
-v `pwd`:/go/src/$(PACKAGE_NAME) \
-w /go/src/$(PACKAGE_NAME) \
goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
--rm-dist --skip-validate --timeout=1h
--clean --skip=validate --timeout=1h

.PHONY: clean
clean:
Expand All @@ -58,10 +58,14 @@ clean:
GOBIN=`pwd` go clean -i ./builtin/...
GOBIN=`pwd` go clean

.PHONY: doc apidoc test ui updatetestcert
doc:
#scripts/run doc --dir website/docs/cli
cd website; yarn build --out-dir ../public
.PHONY: docs apidoc test ui updatetestcert
docs:
# scripts/run doc --dir website/docs/cli

# Build with docker while bun reach compatibility with docusaurs
# cd website; bun run yarn build --out-dir ../public
docker run -v `pwd`:/app --workdir /app/website node yarn build --out-dir ../public

ghp-import -p public

test:
Expand All @@ -72,24 +76,30 @@ localtest:

updatetestcert:
wget https://badssl.com/certs/badssl.com-client.p12 -q -O badssl.com-client.p12
openssl pkcs12 -in badssl.com-client.p12 -nocerts -nodes -passin pass:badssl.com -out builtin/bins/dkron-executor-http/testdata/badssl.com-client-key-decrypted.pem
openssl pkcs12 -in badssl.com-client.p12 -nokeys -passin pass:badssl.com -out builtin/bins/dkron-executor-http/testdata/badssl.com-client.pem
openssl pkcs12 -in badssl.com-client.p12 -nocerts -nodes -passin pass:badssl.com -out plugin/http/testdata/badssl.com-client-key-decrypted.pem
openssl pkcs12 -in badssl.com-client.p12 -nokeys -passin pass:badssl.com -out plugin/http/testdata/badssl.com-client.pem
rm badssl.com-client.p12

ui/node_modules: ui/package.json
cd ui; npm install
cd ui; bun install
# touch the directory so Make understands it is up to date
touch ui/node_modules

dkron/ui-dist: ui/node_modules ui/public/* ui/src/* ui/src/*/*
cd ui; npm run-script build
rm -rf dkron/ui-dist
cd ui; bun run build --out-dir ../dkron/ui-dist

plugin/types/%.pb.go: proto/%.proto
protoc -I proto/ --go_out=plugin/types --go_opt=paths=source_relative --go-grpc_out=plugin/types --go-grpc_opt=paths=source_relative $<
proto: types/dkron.pb.go types/executor.pb.go types/pro.pb.go

types/%.pb.go: proto/%.proto
protoc -I proto/ --go_out=types --go_opt=paths=source_relative --go-grpc_out=types --go-grpc_opt=paths=source_relative $<

client:
oapi-codegen -package client website/static/openapi/openapi.yaml > client/client.go

ui: dkron/ui-dist

main: dkron/ui-dist plugin/types/dkron.pb.go plugin/types/executor.pb.go *.go */*.go */*/*.go */*/*/*.go
main: dkron/ui-dist types/dkron.pb.go types/executor.pb.go *.go */*.go */*/*.go */*/*/*.go
GOBIN=`pwd` go install ./builtin/...
go mod tidy
go build main.go
19 changes: 10 additions & 9 deletions builtin/bins/dkron-executor-gcppubsub/gcppubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"fmt"

"cloud.google.com/go/pubsub"
dkplugin "github.com/distribworks/dkron/v3/plugin"
dktypes "github.com/distribworks/dkron/v3/plugin/types"
dkplugin "github.com/distribworks/dkron/v4/plugin"
dktypes "github.com/distribworks/dkron/v4/types"
)

// GCPPubSub plugin publish message to topic when Execute method is called.
Expand All @@ -24,12 +24,13 @@ const (

// Execute Process method of the plugin
// "executor": "gcppubsub",
// "executor_config": {
// "project": "project-id",
// "topic": "topic-name",
// "data": "aGVsbG8gd29ybGQ=" // Optional. base64 encoded data
// "attributes": "{\"hello\":\"world\",\"waka\":\"paka\"}" // JSON serialized attributes
// }
//
// "executor_config": {
// "project": "project-id",
// "topic": "topic-name",
// "data": "aGVsbG8gd29ybGQ=" // Optional. base64 encoded data
// "attributes": "{\"hello\":\"world\",\"waka\":\"paka\"}" // JSON serialized attributes
// }
func (g *GCPPubSub) Execute(args *dktypes.ExecuteRequest, _ dkplugin.StatusHelper) (*dktypes.ExecuteResponse, error) {
out, err := g.ExecuteImpl(args)
resp := &dktypes.ExecuteResponse{Output: out}
Expand Down Expand Up @@ -91,7 +92,7 @@ func configToPubSubMessage(config map[string]string) (*pubsub.Message, error) {

var attributes map[string]string
if attributesJSON != "" {
if err := json.Unmarshal([]byte(attributesJSON), &attributes); err != nil {
if err := json.Unmarshal([]byte(attributesJSON), &attributes); err != nil {
return nil, fmt.Errorf("invalid attributes JSON: %w", err)
}
msg.Attributes = attributes
Expand Down
2 changes: 1 addition & 1 deletion builtin/bins/dkron-executor-gcppubsub/gcppubsub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

"cloud.google.com/go/pubsub"
dktypes "github.com/distribworks/dkron/v3/plugin/types"
dktypes "github.com/distribworks/dkron/v4/types"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion builtin/bins/dkron-executor-gcppubsub/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
dkplugin "github.com/distribworks/dkron/v3/plugin"
dkplugin "github.com/distribworks/dkron/v4/plugin"
"github.com/hashicorp/go-plugin"
)

Expand Down
Loading
Loading