Skip to content

Commit

Permalink
Merge branch 'main' into 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
vcastellm committed Feb 10, 2024
2 parents f05aefe + 98e1c1c commit 03fb813
Show file tree
Hide file tree
Showing 36 changed files with 15,422 additions and 9,864 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ build
# Generated files
.docusaurus
.cache-loader
.yarn

# Misc
.env.local
Expand Down
20 changes: 10 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module github.com/distribworks/dkron/v4

require (
cloud.google.com/go/pubsub v1.33.0
cloud.google.com/go/pubsub v1.36.0
github.com/DataDog/datadog-go v4.8.3+incompatible // indirect
github.com/Microsoft/go-winio v0.5.1 // indirect
github.com/Shopify/sarama v1.38.1
Expand All @@ -17,7 +17,7 @@ require (
github.com/gin-gonic/gin v1.9.1
github.com/golang/protobuf v1.5.3
github.com/hashicorp/go-discover v0.0.0-20210818145131-c573d69da192
github.com/hashicorp/go-hclog v1.6.1
github.com/hashicorp/go-hclog v1.6.2
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-plugin v1.6.0
github.com/hashicorp/go-sockaddr v1.0.6
Expand All @@ -28,30 +28,30 @@ require (
github.com/hashicorp/raft v1.6.0
github.com/hashicorp/raft-boltdb v0.0.0-20211202195631-7d34b9fb3f42
github.com/hashicorp/serf v0.10.1
github.com/jhump/protoreflect v1.15.4
github.com/jhump/protoreflect v1.15.5
github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0
github.com/mattn/go-shellwords v1.0.12
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/nats-io/nats.go v1.31.0
github.com/nats-io/nats.go v1.32.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.17.0
github.com/prometheus/client_golang v1.18.0
github.com/robfig/cron/v3 v3.0.1
github.com/ryanuber/columnize v2.1.2+incompatible
github.com/shirou/gopsutil/v3 v3.23.11
github.com/shirou/gopsutil/v3 v3.23.12
github.com/sirupsen/logrus v1.9.3
github.com/soheilhy/cmux v0.1.5
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.18.1
github.com/spf13/viper v1.18.2
github.com/streadway/amqp v1.1.0
github.com/stretchr/testify v1.8.4
github.com/tencentcloud/tencentcloud-sdk-go v3.0.83+incompatible // indirect
github.com/tidwall/buntdb v1.2.7
github.com/ugorji/go v1.2.7 // indirect
golang.org/x/net v0.19.0
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.31.1-0.20231027082548-f4a6c1f6e5c1
golang.org/x/net v0.20.0
google.golang.org/grpc v1.61.0
google.golang.org/protobuf v1.32.0
)

go 1.16
188 changes: 155 additions & 33 deletions go.sum

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Minimal example using environment var credentials
plugin: equinix.metal.device
plugin: equinix.cloud.metal_device

keyed_groups:
# Add hosts to tag_Name groups for each tag
Expand Down
48 changes: 20 additions & 28 deletions scripts/ansible/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,39 @@
# Install Dkron beta on a clean instance

- hosts: localhost
vars:
project_id: 904af849-79ff-4847-90f7-dfa02367ae72

tasks:
- equinix.metal.device:
hostnames: [dkron01, dkron02, dkron03]
- equinix.cloud.metal_device:
hostname: "{{ item }}"
operating_system: ubuntu_22_04
plan: c3.small.x86
facility: am6
wait_for_public_IPv: 4
project_id: 904af849-79ff-4847-90f7-dfa02367ae72
metro: am
project_id: "{{ project_id }}"
tags:
- server
register: newhosts
loop:
- dkron01
- dkron02
- dkron03

- equinix.metal.device:
hostnames: [dkron04]
- equinix.cloud.metal_device:
hostname: dkron04
operating_system: ubuntu_22_04
plan: c3.small.x86
facility: am6
wait_for_public_IPv: 4
project_id: 904af849-79ff-4847-90f7-dfa02367ae72
metro: am
project_id: "{{ project_id }}"
tags:
- agent
register: newhosts

- debug: var=newhosts

- name: wait for ssh
wait_for:
delay: 1
host: "{{ item.public_ipv4 }}"
port: 22
state: started
timeout: 500
loop: "{{ newhosts.devices }}"

- hosts: equinix_metal

- hosts: all
user: root
become: true
become_method: sudo

vars:
version: 3.2.2
version: 3.2.7
datadog_api_key: "{{ lookup('ansible.builtin.env', 'DKRON_DD_API_KEY') }}"
datadog_checks:
openmetrics:
Expand All @@ -55,7 +47,7 @@

roles:
- role: datadog.datadog
become: yes
become: true
tags: datadog

tasks:
Expand Down Expand Up @@ -130,7 +122,7 @@
become_method: sudo

vars:
version: 3.2.0
version: 3.2.7
dkron_log_level: debug
dkron_bootstrap_expect: 3
dkron_data_dir: /var/lib/dkron
Expand Down
Binary file added website/.yarn/install-state.gz
Binary file not shown.
1 change: 1 addition & 0 deletions website/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
2 changes: 2 additions & 0 deletions website/docs/cli/dkron_completion_bash.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ If it is not installed already, you can install it via your OS's package manager

To load completions in your current shell session:

```
source <(dkron completion bash)
```

To load completions for every new session, execute once:

Expand Down
2 changes: 1 addition & 1 deletion website/docs/cli/dkron_completion_zsh.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ To load completions for every new session, execute once:

#### Linux:

dkron completion zsh > "${fpath[1]}/_dkron"
dkron completion zsh > "~/.zsh/completion/_dkron"

#### macOS:

Expand Down
4 changes: 2 additions & 2 deletions website/docs/pro/acls.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ The ACL system is designed to be easy to use and fast to enforce while providing

* **ACL Policies.** Dkron's ACL policies are simple JSON documents that define patterns to allow access to resources. You can find below an example ACL policy that works with the default OPA policy. The ACL JSON structure is not rigid you can adapt it to add new features in combination with the OPA Policy rules.

{{% notice note %}}
:::info
This guide is based on the usage of the default OPA Rego Policy
{{% /notice %}}
:::

## Configuring ACLs

Expand Down
2 changes: 2 additions & 0 deletions website/docs/pro/cli/dkron_completion_bash.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ If it is not installed already, you can install it via your OS's package manager

To load completions in your current shell session:

```
source <(dkron completion bash)
```

To load completions for every new session, execute once:

Expand Down
4 changes: 3 additions & 1 deletion website/docs/pro/cli/dkron_completion_zsh.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ to enable it. You can execute the following once:

To load completions in your current shell session:

```
source <(dkron completion zsh)
```

To load completions for every new session, execute once:

#### Linux:

dkron completion zsh > "${fpath[1]}/_dkron"
dkron completion zsh > "~/.zsh/completion/_dkron"

#### macOS:

Expand Down
14 changes: 8 additions & 6 deletions website/docs/usage/cron-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ You may use one of several pre-defined schedules in place of a cron expression.
You may also schedule a job to execute at fixed intervals. This is supported by
formatting the cron spec like this:

@every <duration>
```
@every <duration>
```

where "duration" is a string accepted by time.ParseDuration
(<http://golang.org/pkg/time/#ParseDuration>).
where "duration" is a string accepted by time.ParseDuration http://golang.org/pkg/time/#ParseDuration.

For example, "@every 1h30m10s" would indicate a schedule that activates every
1 hour, 30 minutes, 10 seconds.
Expand All @@ -87,10 +88,11 @@ it will have only 2 minutes of idle time between each run.
You may also want to schedule a job to be executed once. This is supported by
formatting the cron spec like this:

```
@at <datetime>
```

Where "datetime" is a string accepted by time.Parse in RFC3339 format
(<https://golang.org/pkg/time/#Parse>).
Where "datetime" is a string accepted by time.Parse in RFC3339 format https://golang.org/pkg/time/#Parse.

For example, "@at 2018-01-02T15:04:00Z" would run the job on the specified date and time
assuming UTC timezone.
Expand All @@ -103,7 +105,7 @@ job definition.
If the time zone is not specified, the following rules apply:

All interpretation and scheduling is done in the machine's local time zone (as
provided by the Go time package (<http://www.golang.org/pkg/time>).
provided by the Go time package http://www.golang.org/pkg/time.

Be aware that jobs scheduled during daylight-savings leap-ahead transitions will
not be run!
Expand Down
14 changes: 13 additions & 1 deletion website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,19 @@ const config = {
description_extended: 'Dkron is a system service for workload automation that runs scheduled jobs, just like unix cron service but distributed in several machines in a cluster. This is the only job scheduler in the market with truly no SPOF. It is open source and available for free.'
},

plugins: ['tailwindcss-loader'],
plugins: [
async function myPlugin(context, options) {
return {
name: "docusaurus-tailwindcss",
configurePostCss(postcssOptions) {
// Appends TailwindCSS and AutoPrefixer.
postcssOptions.plugins.push(require("tailwindcss"));
postcssOptions.plugins.push(require("autoprefixer"));
return postcssOptions;
},
};
},
],

markdown: {
mermaid: true,
Expand Down
18 changes: 9 additions & 9 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "^2.2.0",
"@docusaurus/preset-classic": "^2.2.0",
"@docusaurus/theme-mermaid": "^2.2.0",
"@docusaurus/core": "^3.0.1",
"@docusaurus/preset-classic": "^3.0.1",
"@docusaurus/theme-mermaid": "^3.0.1",
"@heroicons/react": "^1.0.5",
"@mdx-js/react": "^1.6.21",
"autoprefixer": "^10.4.2",
Expand All @@ -27,14 +27,13 @@
"postcss": "^8.4.6",
"postcss-import": "^14.0.2",
"prism-react-renderer": "^1.2.1",
"react": "^17.0.1",
"react": "^18.2.0",
"react-countup": "^6.2.0",
"react-dom": "^17.0.1",
"redocusaurus": "^1.0.2",
"react-dom": "^18.2.0",
"redocusaurus": "^2.0.0",
"stream": "^0.0.2",
"swagger-ui-react": "^4.5.2",
"tailwindcss": "^3.0.23",
"tailwindcss-loader": "file:plugins/tailwindcss-loader"
"tailwindcss": "^3.0.23"
},
"browserslist": {
"production": [
Expand All @@ -47,5 +46,6 @@
"last 1 firefox version",
"last 1 safari version"
]
}
},
"packageManager": "[email protected]"
}
12 changes: 0 additions & 12 deletions website/plugins/tailwindcss-loader/index.js

This file was deleted.

2 changes: 1 addition & 1 deletion website/src/pages/license.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
Copyright (c) Victor Castell

Dkron is an Open Source project licensed under the terms of
the LGPLv3 license. Please see <http://www.gnu.org/licenses/lgpl-3.0.html>
the LGPLv3 license. Please see http://www.gnu.org/licenses/lgpl-3.0.html
for license text.
12 changes: 6 additions & 6 deletions website/versioned_docs/version-v1/basics/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ All the execution responses will be gathered by the scheduler and stored in the

Dkron relies on the key-value store for data storage, an instance of the distributed store can be run in the same machines as Dkron or connect it to an already existing cluster.

{{% notice note %}}
:::note
By default dkron will start with a file based, embedded KV store called BoltDB, it is functional for a single node demo but does not offers clustering or HA.
{{% /notice %}}
:::

It is compatible with etcd, Consul, Zookeeper, Redis, DynamoDB and BoltDB. For instructions on how to install and configure any one of these systems refer to their official sites:

Expand All @@ -53,9 +53,9 @@ By default Dkron uses the following ports:
- `8080` for HTTP for the API and Dashboard
- `6868` for RPC comunication between agents.

{{% notice note %}}
:::note
Be sure you have opened this ports (or the ones that you configured) in your firewall or AWS security groups.
{{% /notice %}}
:::

By default dkron will use the embedded BoltDB KV store. A different store can be specified setting `backend` and `backend-machines` flag in the config file, env variables or as a command line flag.

Expand All @@ -67,9 +67,9 @@ dkron agent --server

Time to add the first job:

{{% notice note %}}
:::note
This job will only run in just one `dkron_server` node due to the node count in the tag. Refer to the [target node spec](/docs/usage/target-nodes-spec) for details.
{{% /notice %}}
:::

```bash
curl localhost:8080/v1/jobs -XPOST -d '{
Expand Down
4 changes: 2 additions & 2 deletions website/versioned_docs/version-v1/basics/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Run Dkron with default setting: `dkron agent --server`
Navigate to http://localhost:8080


{{% notice note %}}
:::note
By default dkron will start with a file based, embedded KV store called BoltDB, it is functional for a single node demo but does not offers clustering or HA.
{{% /notice %}}
:::

## Installing the package

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-v1/intro/license.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ toc: false
Copyright (c) Victor Castell

Dkron is an Open Source project licensed under the terms of
the LGPLv3 license. Please see <http://www.gnu.org/licenses/lgpl-3.0.html>
the LGPLv3 license. Please see http://www.gnu.org/licenses/lgpl-3.0.html
for license text.
Loading

0 comments on commit 03fb813

Please sign in to comment.