diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7696b1f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +name: CI + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup Go for use with actions + uses: actions/setup-go@v2 + with: + go-version: 1.15 + - name: Install goimports + run: go get golang.org/x/tools/cmd/goimports + - name: Set env with list of directories in repo containin go code + run: echo GO_USR_DIRS=$(go list -f {{.Dir}} ./... | grep -E -v "/gen-go/|/vendor/") >> $GITHUB_ENV + - name: Run goimports check + run: test -z `for d in $GO_USR_DIRS; do goimports -d "$d" | tee /dev/stderr; done` + - name: Run tests + run: go build -o australis *.go diff --git a/cmd/completion.go b/cmd/completion.go index efc260e..258a45f 100644 --- a/cmd/completion.go +++ b/cmd/completion.go @@ -42,4 +42,3 @@ In MacOS this directory is $(brew --prefix)/etc/bash_completion.d if auto comple rootCmd.GenBashCompletionFile(filename) }, } - diff --git a/cmd/create.go b/cmd/create.go index c062c4c..6ea8b93 100644 --- a/cmd/create.go +++ b/cmd/create.go @@ -21,13 +21,14 @@ import ( func init() { rootCmd.AddCommand(createCmd) + createCmd.Flags().BoolVarP(&monitor, "monitor", "m", true, "monitor the result after sending the command") } var createCmd = &cobra.Command{ Use: "create", Short: "Create an Aurora Job", Run: createJob, - Args: cobra.ExactArgs(1), + Args: cobra.RangeArgs(1, 2), } func createJob(cmd *cobra.Command, args []string) { @@ -46,14 +47,15 @@ func createJob(cmd *cobra.Command, args []string) { log.Fatal("unable to create Aurora job: ", err) } - if ok, monitorErr := client.MonitorInstances(auroraJob.JobKey(), - auroraJob.GetInstanceCount(), - 5, - 50); !ok || monitorErr != nil { - if err := client.KillJob(auroraJob.JobKey()); err != nil { - log.Fatal(monitorErr, err) + if monitor { + if ok, monitorErr := client.MonitorInstances(auroraJob.JobKey(), + auroraJob.GetInstanceCount(), + 5, + 50); !ok || monitorErr != nil { + if err := client.KillJob(auroraJob.JobKey()); err != nil { + log.Fatal(monitorErr, err) + } + log.Fatal(monitorErr) } - log.Fatal(monitorErr) } - } diff --git a/cmd/kill.go b/cmd/kill.go index 3c3542b..88d1d9f 100644 --- a/cmd/kill.go +++ b/cmd/kill.go @@ -30,6 +30,7 @@ func init() { killJobCmd.Flags().StringVarP(env, "environment", "e", "", "Aurora Environment") killJobCmd.Flags().StringVarP(role, "role", "r", "", "Aurora Role") killJobCmd.Flags().StringVarP(name, "name", "n", "", "Aurora Name") + killJobCmd.Flags().BoolVarP(&monitor, "monitor", "m", true, "monitor the result after sending the command") killJobCmd.MarkFlagRequired("environment") killJobCmd.MarkFlagRequired("role") killJobCmd.MarkFlagRequired("name") @@ -57,8 +58,9 @@ func killJob(cmd *cobra.Command, args []string) { if err != nil { log.Fatalln(err) } - - if ok, err := client.MonitorInstances(job.JobKey(), 0, 5, 50); !ok || err != nil { - log.Fatalln("Unable to kill all instances of job") + if monitor { + if ok, err := client.MonitorInstances(job.JobKey(), 0, 5, 50); !ok || err != nil { + log.Fatalln("Unable to kill all instances of job") + } } } diff --git a/cmd/restart.go b/cmd/restart.go index e5f8701..d90d5fd 100644 --- a/cmd/restart.go +++ b/cmd/restart.go @@ -15,34 +15,33 @@ package cmd import ( - "github.com/aurora-scheduler/gorealis/v2/gen-go/apache/aurora" - "github.com/spf13/cobra" + "github.com/aurora-scheduler/gorealis/v2/gen-go/apache/aurora" + "github.com/spf13/cobra" ) func init() { - rootCmd.AddCommand(restartCmd) + rootCmd.AddCommand(restartCmd) - - restartCmd.AddCommand(restartJobCmd) - restartJobCmd.Flags().StringVarP(env, "environment", "e", "", "Aurora Environment") - restartJobCmd.Flags().StringVarP(role, "role", "r", "", "Aurora Role") - restartJobCmd.Flags().StringVarP(name, "name", "n", "", "Aurora Name") + restartCmd.AddCommand(restartJobCmd) + restartJobCmd.Flags().StringVarP(env, "environment", "e", "", "Aurora Environment") + restartJobCmd.Flags().StringVarP(role, "role", "r", "", "Aurora Role") + restartJobCmd.Flags().StringVarP(name, "name", "n", "", "Aurora Name") } var restartCmd = &cobra.Command{ - Use: "restart", - Short: "Restart an Aurora Job.", + Use: "restart", + Short: "Restart an Aurora Job.", } var restartJobCmd = &cobra.Command{ - Use: "job", - Short: "Restart a Job.", - Run: restartJob, + Use: "job", + Short: "Restart a Job.", + Run: restartJob, } func restartJob(cmd *cobra.Command, args []string) { - key := aurora.JobKey{Environment: *env, Role: *role, Name: *name} - if err := client.RestartJob(key); err != nil { - log.Fatal("unable to create Aurora job: ", err) - } + key := aurora.JobKey{Environment: *env, Role: *role, Name: *name} + if err := client.RestartJob(key); err != nil { + log.Fatal("unable to create Aurora job: ", err) + } } diff --git a/cmd/root.go b/cmd/root.go index ad50772..3b5889d 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -46,9 +46,11 @@ var count int64 var filename string var message = new(string) var updateID string +var monitor bool +var timeout time.Duration // seconds var log = logrus.New() -const australisVer = "v0.22.0" +const australisVer = "v1.0.1" var forceDrainTimeout time.Duration @@ -67,6 +69,7 @@ func init() { rootCmd.PersistentFlags().StringVar(&configFile, "config", "/etc/aurora/australis.yml", "Config file to use.") rootCmd.PersistentFlags().BoolVar(&toJson, "toJSON", false, "Print output in JSON format.") rootCmd.PersistentFlags().StringVarP(&logLevel, "logLevel", "l", "info", "Set logging level ["+internal.GetLoggingLevels()+"].") + rootCmd.PersistentFlags().DurationVarP(&timeout, "timeout", "t", 20*time.Second, "Gorealis timeout.") } var rootCmd = &cobra.Command{ @@ -141,7 +144,7 @@ func connect(cmd *cobra.Command, args []string) { realisOptions := []realis.ClientOption{realis.BasicAuth(username, password), realis.ThriftJSON(), - realis.Timeout(20 * time.Second), + realis.Timeout(timeout), realis.BackOff(realis.Backoff{ Steps: 2, Duration: 10 * time.Second, diff --git a/deb-packaging/Dockerfile b/deb-packaging/Dockerfile index ab6b14e..6088aa8 100644 --- a/deb-packaging/Dockerfile +++ b/deb-packaging/Dockerfile @@ -2,7 +2,7 @@ FROM ubuntu:16.04 RUN apt-get update -y && \ apt-get install -y build-essential devscripts dh-exec dh-make git lintian wget && \ - wget https://dl.google.com/go/go1.12.6.linux-amd64.tar.gz -O /tmp/go.tar.gz + wget https://dl.google.com/go/go1.15.2.linux-amd64.tar.gz -O /tmp/go.tar.gz RUN tar -C /usr/local -xzf /tmp/go.tar.gz diff --git a/deb-packaging/build_deb.sh b/deb-packaging/build_deb.sh index 6906d3d..958eaa8 100644 --- a/deb-packaging/build_deb.sh +++ b/deb-packaging/build_deb.sh @@ -2,4 +2,4 @@ docker build . -t australis_deb_builder -docker run --rm -v $HOME/go/pkg/mod:/go/pkg/mod -v $(pwd)/..:/australis australis_builder +docker run --rm -v $HOME/go/pkg/mod:/go/pkg/mod -v $(pwd)/..:/australis australis_deb_builder diff --git a/deb-packaging/entrypoint.sh b/deb-packaging/entrypoint.sh index b871d59..601733e 100755 --- a/deb-packaging/entrypoint.sh +++ b/deb-packaging/entrypoint.sh @@ -1,12 +1,9 @@ #!/bin/bash -# Temporary fix for a go mods bug -rm /australis/go.sum - # Build debian package cd /australis debuild -d -us -uc -b # Move resulting packages to the dist folder mkdir -p /australis/dist -mv /australis_*_amd64* /australis/dist \ No newline at end of file +mv /australis_*_amd64* /australis/dist diff --git a/debian/changelog b/debian/changelog index 50dc650..96a761f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,22 @@ -australis (0.1.2) unstable; urgency=medium +australis (1.0.1) stable; urgency=medium - * Unreleased + * Added flag -m and --monitor that can be set in order to monitor a job creation or a job kill. By default monitor is set to true. - -- Renan DelValle Mon, 19 Feb 2020 12:00:00 -0700 + -- Renan Del Valle Wed, 30 Sep 2020 16:46:56 -0700 + +australis (1.0.0) stable; urgency=medium + + * First stable release. + + -- Renan Del Valle Wed, 30 Sep 2020 15:39:29 -0700 + +australis (0.22.0) unstable; urgency=medium + + * Added support for starting job updates. + * Added support for setting SlaAwareness for updates. + * Added upport for scheduling cron jobs. + + -- Renan Del Valle Thu, 07 May 2020 12:00:00 -0700 australis (0.1.1) unstable; urgency=medium diff --git a/docs/australis.md b/docs/australis.md index 1374c86..352c6f6 100644 --- a/docs/australis.md +++ b/docs/australis.md @@ -18,6 +18,7 @@ A light-weight command line client for use with Apache Aurora built using goreal -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -39,4 +40,4 @@ A light-weight command line client for use with Apache Aurora built using goreal * [australis start](australis_start.md) - Start a service, maintenance on a host (DRAIN), a snapshot, an update, or a backup. * [australis stop](australis_stop.md) - Stop a service or maintenance on a host (DRAIN). -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_create.md b/docs/australis_create.md index 3a605c8..8069bc2 100644 --- a/docs/australis_create.md +++ b/docs/australis_create.md @@ -13,7 +13,8 @@ australis create [flags] ### Options ``` - -h, --help help for create + -h, --help help for create + -m, --monitor monitor the result after sending the command (default true) ``` ### Options inherited from parent commands @@ -27,6 +28,7 @@ australis create [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -36,4 +38,4 @@ australis create [flags] * [australis](australis.md) - australis is a client for Apache Aurora -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_fetch.md b/docs/australis_fetch.md index d229a42..2f365c8 100644 --- a/docs/australis_fetch.md +++ b/docs/australis_fetch.md @@ -23,6 +23,7 @@ Fetch information from Aurora -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -36,4 +37,4 @@ Fetch information from Aurora * [australis fetch status](australis_fetch_status.md) - Fetch the maintenance status of a node from Aurora * [australis fetch task](australis_fetch_task.md) - Task information from Aurora -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_fetch_jobs.md b/docs/australis_fetch_jobs.md index ad9c045..2f2dc6c 100644 --- a/docs/australis_fetch_jobs.md +++ b/docs/australis_fetch_jobs.md @@ -28,6 +28,7 @@ australis fetch jobs [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -37,4 +38,4 @@ australis fetch jobs [flags] * [australis fetch](australis_fetch.md) - Fetch information from Aurora -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_fetch_leader.md b/docs/australis_fetch_leader.md index e69dab3..dd99c47 100644 --- a/docs/australis_fetch_leader.md +++ b/docs/australis_fetch_leader.md @@ -29,6 +29,7 @@ australis fetch leader [zkNode0, zkNode1, ...zkNodeN] [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -38,4 +39,4 @@ australis fetch leader [zkNode0, zkNode1, ...zkNodeN] [flags] * [australis fetch](australis_fetch.md) - Fetch information from Aurora -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_fetch_status.md b/docs/australis_fetch_status.md index 62f944e..373ceaa 100644 --- a/docs/australis_fetch_status.md +++ b/docs/australis_fetch_status.md @@ -27,6 +27,7 @@ australis fetch status [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -36,4 +37,4 @@ australis fetch status [flags] * [australis fetch](australis_fetch.md) - Fetch information from Aurora -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_fetch_task.md b/docs/australis_fetch_task.md index b902053..70fff8e 100644 --- a/docs/australis_fetch_task.md +++ b/docs/australis_fetch_task.md @@ -23,6 +23,7 @@ Task information from Aurora -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -34,4 +35,4 @@ Task information from Aurora * [australis fetch task config](australis_fetch_task_config.md) - Fetch a list of task configurations from Aurora. * [australis fetch task status](australis_fetch_task_status.md) - Fetch task status for a Job key. -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_fetch_task_config.md b/docs/australis_fetch_task_config.md index 88e6c56..6dae394 100644 --- a/docs/australis_fetch_task_config.md +++ b/docs/australis_fetch_task_config.md @@ -30,6 +30,7 @@ australis fetch task config [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -39,4 +40,4 @@ australis fetch task config [flags] * [australis fetch task](australis_fetch_task.md) - Task information from Aurora -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_fetch_task_status.md b/docs/australis_fetch_task_status.md index f378e3c..5cbdf79 100644 --- a/docs/australis_fetch_task_status.md +++ b/docs/australis_fetch_task_status.md @@ -30,6 +30,7 @@ australis fetch task status [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -39,4 +40,4 @@ australis fetch task status [flags] * [australis fetch task](australis_fetch_task.md) - Task information from Aurora -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_force.md b/docs/australis_force.md index cd62da0..6aaccb3 100644 --- a/docs/australis_force.md +++ b/docs/australis_force.md @@ -23,6 +23,7 @@ Force the scheduler to do a snapshot, a backup, or a task reconciliation. -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -35,4 +36,4 @@ Force the scheduler to do a snapshot, a backup, or a task reconciliation. * [australis force recon](australis_force_recon.md) - Force the leading scheduler to perform a reconciliation. * [australis force snapshot](australis_force_snapshot.md) - Force the leading scheduler to perform a Snapshot. -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_force_backup.md b/docs/australis_force_backup.md index 453c91f..1fd0a74 100644 --- a/docs/australis_force_backup.md +++ b/docs/australis_force_backup.md @@ -28,6 +28,7 @@ australis force backup [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -37,4 +38,4 @@ australis force backup [flags] * [australis force](australis_force.md) - Force the scheduler to do a snapshot, a backup, or a task reconciliation. -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_force_recon.md b/docs/australis_force_recon.md index 17758d2..9907fed 100644 --- a/docs/australis_force_recon.md +++ b/docs/australis_force_recon.md @@ -30,6 +30,7 @@ state for all currently known non-terminal tasks. -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -41,4 +42,4 @@ state for all currently known non-terminal tasks. * [australis force recon explicit](australis_force_recon_explicit.md) - Force the leading scheduler to perform an explicit recon. * [australis force recon implicit](australis_force_recon_implicit.md) - Force the leading scheduler to perform an implicit recon. -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_force_recon_explicit.md b/docs/australis_force_recon_explicit.md index 802450b..113316c 100644 --- a/docs/australis_force_recon_explicit.md +++ b/docs/australis_force_recon_explicit.md @@ -29,6 +29,7 @@ australis force recon explicit [batch_size] [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -38,4 +39,4 @@ australis force recon explicit [batch_size] [flags] * [australis force recon](australis_force_recon.md) - Force the leading scheduler to perform a reconciliation. -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_force_recon_implicit.md b/docs/australis_force_recon_implicit.md index ff30e2b..932f390 100644 --- a/docs/australis_force_recon_implicit.md +++ b/docs/australis_force_recon_implicit.md @@ -28,6 +28,7 @@ australis force recon implicit [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -37,4 +38,4 @@ australis force recon implicit [flags] * [australis force recon](australis_force_recon.md) - Force the leading scheduler to perform a reconciliation. -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_force_snapshot.md b/docs/australis_force_snapshot.md index 8ce8081..f6207a3 100644 --- a/docs/australis_force_snapshot.md +++ b/docs/australis_force_snapshot.md @@ -28,6 +28,7 @@ australis force snapshot [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -37,4 +38,4 @@ australis force snapshot [flags] * [australis force](australis_force.md) - Force the scheduler to do a snapshot, a backup, or a task reconciliation. -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_kill.md b/docs/australis_kill.md index 89e914d..69403b7 100644 --- a/docs/australis_kill.md +++ b/docs/australis_kill.md @@ -23,6 +23,7 @@ Kill an Aurora Job -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -33,4 +34,4 @@ Kill an Aurora Job * [australis](australis.md) - australis is a client for Apache Aurora * [australis kill job](australis_kill_job.md) - Kill an Aurora Job -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_kill_entire-cluster.md b/docs/australis_kill_entire-cluster.md deleted file mode 100644 index 5d8585d..0000000 --- a/docs/australis_kill_entire-cluster.md +++ /dev/null @@ -1,39 +0,0 @@ -## australis kill entire-cluster - -Kill every task in the cluster. - -### Synopsis - -To be written. - -``` -australis kill entire-cluster [flags] -``` - -### Options - -``` - -h, --help help for entire-cluster -``` - -### Options inherited from parent commands - -``` - -a, --caCertsPath string Path where CA certificates can be found. - -c, --clientCert string Client certificate to use to connect to Aurora. - -k, --clientKey string Client key to use to connect to Aurora. - --config string Config file to use. (default "/etc/aurora/australis.yml") - -l, --logLevel string Set logging level [panic fatal error warning info debug trace]. (default "info") - -p, --password string Password to use for API authentication - -s, --scheduler_addr string Aurora Scheduler's address. - -i, --skipCertVerification Skip CA certificate hostname verification. - --toJSON Print output in JSON format. - -u, --username string Username to use for API authentication - -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) -``` - -### SEE ALSO - -* [australis kill](australis_kill.md) - Kill an Aurora Job - -###### Auto generated by spf13/cobra on 22-Mar-2019 diff --git a/docs/australis_kill_job.md b/docs/australis_kill_job.md index 0a12da3..56446f3 100644 --- a/docs/australis_kill_job.md +++ b/docs/australis_kill_job.md @@ -15,6 +15,7 @@ australis kill job [flags] ``` -e, --environment string Aurora Environment -h, --help help for job + -m, --monitor monitor the result after sending the command (default true) -n, --name string Aurora Name -r, --role string Aurora Role ``` @@ -30,6 +31,7 @@ australis kill job [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -39,4 +41,4 @@ australis kill job [flags] * [australis kill](australis_kill.md) - Kill an Aurora Job -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_monitor.md b/docs/australis_monitor.md index aa77d1c..59ba91a 100644 --- a/docs/australis_monitor.md +++ b/docs/australis_monitor.md @@ -23,6 +23,7 @@ Watch for a specific state change -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -33,4 +34,4 @@ Watch for a specific state change * [australis](australis.md) - australis is a client for Apache Aurora * [australis monitor hosts](australis_monitor_hosts.md) - Watch a host maintenance status until it enters one of the desired statuses. -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_monitor_hosts.md b/docs/australis_monitor_hosts.md index 4dd1ded..508fb68 100644 --- a/docs/australis_monitor_hosts.md +++ b/docs/australis_monitor_hosts.md @@ -17,7 +17,6 @@ australis monitor hosts [flags] -h, --help help for hosts --interval duration Interval at which to poll scheduler. (default 5s) --statuses strings List of acceptable statuses for a host to be in. (case-insensitive) [NONE, SCHEDULED, DRAINED, DRAINING] (default [DRAINED]) - --timeout duration Time after which the monitor will stop polling and throw an error. (default 10m0s) ``` ### Options inherited from parent commands @@ -31,6 +30,7 @@ australis monitor hosts [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -40,4 +40,4 @@ australis monitor hosts [flags] * [australis monitor](australis_monitor.md) - Watch for a specific state change -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_pulse.md b/docs/australis_pulse.md index 0dc480a..904e253 100644 --- a/docs/australis_pulse.md +++ b/docs/australis_pulse.md @@ -31,6 +31,7 @@ australis pulse [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -40,4 +41,4 @@ australis pulse [flags] * [australis](australis.md) - australis is a client for Apache Aurora -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_restart.md b/docs/australis_restart.md index 79037d4..6b1aa9f 100644 --- a/docs/australis_restart.md +++ b/docs/australis_restart.md @@ -23,6 +23,7 @@ Restart an Aurora Job. -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -33,4 +34,4 @@ Restart an Aurora Job. * [australis](australis.md) - australis is a client for Apache Aurora * [australis restart job](australis_restart_job.md) - Restart a Job. -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_restart_job.md b/docs/australis_restart_job.md index 4225b66..219c3c2 100644 --- a/docs/australis_restart_job.md +++ b/docs/australis_restart_job.md @@ -30,6 +30,7 @@ australis restart job [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -39,4 +40,4 @@ australis restart job [flags] * [australis restart](australis_restart.md) - Restart an Aurora Job. -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_resume.md b/docs/australis_resume.md index f7697c4..cd9b899 100644 --- a/docs/australis_resume.md +++ b/docs/australis_resume.md @@ -32,6 +32,7 @@ australis resume [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -41,4 +42,4 @@ australis resume [flags] * [australis](australis.md) - australis is a client for Apache Aurora -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_rollback.md b/docs/australis_rollback.md index 7b0f871..3c6fc7d 100644 --- a/docs/australis_rollback.md +++ b/docs/australis_rollback.md @@ -23,6 +23,7 @@ Rollback an operation such as an Update -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -33,4 +34,4 @@ Rollback an operation such as an Update * [australis](australis.md) - australis is a client for Apache Aurora * [australis rollback update](australis_rollback_update.md) - Rollback an update -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_rollback_update.md b/docs/australis_rollback_update.md index 5d798ba..5e45946 100644 --- a/docs/australis_rollback_update.md +++ b/docs/australis_rollback_update.md @@ -32,6 +32,7 @@ australis rollback update [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -41,4 +42,4 @@ australis rollback update [flags] * [australis rollback](australis_rollback.md) - Rollback an operation such as an Update -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_schedule.md b/docs/australis_schedule.md index 0218243..ff97b70 100644 --- a/docs/australis_schedule.md +++ b/docs/australis_schedule.md @@ -27,6 +27,7 @@ australis schedule [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -36,4 +37,4 @@ australis schedule [flags] * [australis](australis.md) - australis is a client for Apache Aurora -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_set.md b/docs/australis_set.md index 6efb0b4..6973c69 100644 --- a/docs/australis_set.md +++ b/docs/australis_set.md @@ -23,6 +23,7 @@ Set a value in the Aurora Scheduler. -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -33,4 +34,4 @@ Set a value in the Aurora Scheduler. * [australis](australis.md) - australis is a client for Apache Aurora * [australis set quota](australis_set_quota.md) - Set Quota resources for a role. -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_set_quota.md b/docs/australis_set_quota.md index 555f195..3e29bb3 100644 --- a/docs/australis_set_quota.md +++ b/docs/australis_set_quota.md @@ -27,6 +27,7 @@ australis set quota cpu: ram: disk: [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -36,4 +37,4 @@ australis set quota cpu: ram: disk: [flags] * [australis set](australis_set.md) - Set a value in the Aurora Scheduler. -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_start.md b/docs/australis_start.md index b4390c7..9a8a8dd 100644 --- a/docs/australis_start.md +++ b/docs/australis_start.md @@ -23,6 +23,7 @@ Start a service, maintenance on a host (DRAIN), a snapshot, an update, or a back -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -36,4 +37,4 @@ Start a service, maintenance on a host (DRAIN), a snapshot, an update, or a back * [australis start sla-drain](australis_start_sla-drain.md) - Place a list of space separated Mesos Agents into maintenance mode using SLA aware strategies. * [australis start update](australis_start_update.md) - Start an update on an Aurora long running service. -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_start_drain.md b/docs/australis_start_drain.md index 5462952..2073cd4 100644 --- a/docs/australis_start_drain.md +++ b/docs/australis_start_drain.md @@ -20,7 +20,6 @@ australis start drain [space separated host list or use JSON flags] [flags] --interval duration Interval at which to poll scheduler. (default 5s) --json Read JSON list of agents from the STDIN. --json-file string JSON file to read list of agents from. - --timeout duration Time after which the monitor will stop polling and throw an error. (default 10m0s) ``` ### Options inherited from parent commands @@ -34,6 +33,7 @@ australis start drain [space separated host list or use JSON flags] [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -43,4 +43,4 @@ australis start drain [space separated host list or use JSON flags] [flags] * [australis start](australis_start.md) - Start a service, maintenance on a host (DRAIN), a snapshot, an update, or a backup. -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_start_maintenance.md b/docs/australis_start_maintenance.md index ff93667..51db1de 100644 --- a/docs/australis_start_maintenance.md +++ b/docs/australis_start_maintenance.md @@ -19,7 +19,6 @@ australis start maintenance [space separated host list or use JSON flags] [flags --interval duration Interval at which to poll scheduler. (default 5s) --json Read JSON list of agents from the STDIN. --json-file string JSON file to read list of agents from. - --timeout duration Time after which the monitor will stop polling and throw an error. (default 10m0s) ``` ### Options inherited from parent commands @@ -33,6 +32,7 @@ australis start maintenance [space separated host list or use JSON flags] [flags -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -42,4 +42,4 @@ australis start maintenance [space separated host list or use JSON flags] [flags * [australis start](australis_start.md) - Start a service, maintenance on a host (DRAIN), a snapshot, an update, or a backup. -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_start_sla-drain.md b/docs/australis_start_sla-drain.md index 831507d..3c0263d 100644 --- a/docs/australis_start_sla-drain.md +++ b/docs/australis_start_sla-drain.md @@ -28,7 +28,6 @@ australis start sla-drain [space separated host list or use JSON flags] [flags] --json-file string JSON file to read list of agents from. --percentage float Percentage of instances that should be running to meet SLA. (default 80) --sla-limit duration Time limit after which SLA-Aware drain sheds SLA Awareness. (default 1h0m0s) - --timeout duration Time after which the monitor will stop polling and throw an error. (default 20m0s) ``` ### Options inherited from parent commands @@ -42,6 +41,7 @@ australis start sla-drain [space separated host list or use JSON flags] [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -51,4 +51,4 @@ australis start sla-drain [space separated host list or use JSON flags] [flags] * [australis start](australis_start.md) - Start a service, maintenance on a host (DRAIN), a snapshot, an update, or a backup. -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_start_sla-drain_count.md b/docs/australis_start_sla-drain_count.md deleted file mode 100644 index 457d559..0000000 --- a/docs/australis_start_sla-drain_count.md +++ /dev/null @@ -1,45 +0,0 @@ -## australis start sla-drain count - -Place a list of space separated Mesos Agents into maintenance mode using the count SLA aware policy as a fallback. - -### Synopsis - -Adds a Mesos Agent to Aurora's Drain list. Tasks will be drained using the count SLA policy as a fallback -when a Job does not have a defined SLA policy. - -``` -australis start sla-drain count [space separated host list] [flags] -``` - -### Options - -``` - --count int Instances count that should be running to meet SLA. (default 5) - --duration RUNNING Minimum time duration a task needs to be RUNNING to be treated as active. (default 45s) - -h, --help help for count - --interval duration Interval at which to poll scheduler. (default 10s) - --sla-limit duration Time limit after which SLA-Aware drain sheds SLA Awareness. (default 1h0m0s) - --timeout duration Time after which the monitor will stop polling and throw an error. (default 20m0s) -``` - -### Options inherited from parent commands - -``` - -a, --caCertsPath string Path where CA certificates can be found. - -c, --clientCert string Client certificate to use to connect to Aurora. - -k, --clientKey string Client key to use to connect to Aurora. - --config string Config file to use. (default "/etc/aurora/australis.yml") - -l, --logLevel string Set logging level [panic fatal error warning info debug trace]. (default "info") - -p, --password string Password to use for API authentication - -s, --scheduler_addr string Aurora Scheduler's address. - -i, --skipCertVerification Skip CA certificate hostname verification. - --toJSON Print output in JSON format. - -u, --username string Username to use for API authentication - -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) -``` - -### SEE ALSO - -* [australis start sla-drain](australis_start_sla-drain.md) - Place a list of space separated Mesos Agents into maintenance mode using SLA aware strategies. - -###### Auto generated by spf13/cobra on 22-Mar-2019 diff --git a/docs/australis_start_sla-drain_percentage.md b/docs/australis_start_sla-drain_percentage.md deleted file mode 100644 index d431564..0000000 --- a/docs/australis_start_sla-drain_percentage.md +++ /dev/null @@ -1,45 +0,0 @@ -## australis start sla-drain percentage - -Place a list of space separated Mesos Agents into maintenance mode using the percentage SLA aware policy as a fallback. - -### Synopsis - -Adds a Mesos Agent to Aurora's Drain list. Tasks will be drained using the percentage SLA policy as a fallback -when a Job does not have a defined SLA policy. - -``` -australis start sla-drain percentage [space separated host list] [flags] -``` - -### Options - -``` - --duration RUNNING Minimum time duration a task needs to be RUNNING to be treated as active. (default 45s) - -h, --help help for percentage - --interval duration Interval at which to poll scheduler. (default 10s) - --percent float Percentage of instances that should be running to meet SLA. (default 75) - --sla-limit duration Time limit after which SLA-Aware drain sheds SLA Awareness. (default 1h0m0s) - --timeout duration Time after which the monitor will stop polling and throw an error. (default 20m0s) -``` - -### Options inherited from parent commands - -``` - -a, --caCertsPath string Path where CA certificates can be found. - -c, --clientCert string Client certificate to use to connect to Aurora. - -k, --clientKey string Client key to use to connect to Aurora. - --config string Config file to use. (default "/etc/aurora/australis.yml") - -l, --logLevel string Set logging level [panic fatal error warning info debug trace]. (default "info") - -p, --password string Password to use for API authentication - -s, --scheduler_addr string Aurora Scheduler's address. - -i, --skipCertVerification Skip CA certificate hostname verification. - --toJSON Print output in JSON format. - -u, --username string Username to use for API authentication - -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) -``` - -### SEE ALSO - -* [australis start sla-drain](australis_start_sla-drain.md) - Place a list of space separated Mesos Agents into maintenance mode using SLA aware strategies. - -###### Auto generated by spf13/cobra on 22-Mar-2019 diff --git a/docs/australis_start_update.md b/docs/australis_start_update.md index bc1f0e0..1bf29cb 100644 --- a/docs/australis_start_update.md +++ b/docs/australis_start_update.md @@ -16,7 +16,6 @@ australis start update [update config] [flags] ``` -h, --help help for update --interval duration Interval at which to poll scheduler. (default 5s) - --timeout duration Time after which the monitor will stop polling and throw an error. (default 10m0s) ``` ### Options inherited from parent commands @@ -30,6 +29,7 @@ australis start update [update config] [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -39,4 +39,4 @@ australis start update [update config] [flags] * [australis start](australis_start.md) - Start a service, maintenance on a host (DRAIN), a snapshot, an update, or a backup. -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_stop.md b/docs/australis_stop.md index f7f8970..6ea3a5e 100644 --- a/docs/australis_stop.md +++ b/docs/australis_stop.md @@ -23,6 +23,7 @@ Stop a service or maintenance on a host (DRAIN). -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -34,4 +35,4 @@ Stop a service or maintenance on a host (DRAIN). * [australis stop drain](australis_stop_drain.md) - Stop maintenance on a host (move to NONE). * [australis stop update](australis_stop_update.md) - Stop update -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_stop_drain.md b/docs/australis_stop_drain.md index f9fb293..705e07c 100644 --- a/docs/australis_stop_drain.md +++ b/docs/australis_stop_drain.md @@ -15,7 +15,6 @@ australis stop drain [space separated host list] [flags] ``` -h, --help help for drain --interval duration Interval at which to poll scheduler. (default 5s) - --timeout duration Time after which the monitor will stop polling and throw an error. (default 1m0s) ``` ### Options inherited from parent commands @@ -29,6 +28,7 @@ australis stop drain [space separated host list] [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -38,4 +38,4 @@ australis stop drain [space separated host list] [flags] * [australis stop](australis_stop.md) - Stop a service or maintenance on a host (DRAIN). -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/docs/australis_stop_update.md b/docs/australis_stop_update.md index 894925b..f597259 100644 --- a/docs/australis_stop_update.md +++ b/docs/australis_stop_update.md @@ -30,6 +30,7 @@ australis stop update [update ID] [flags] -p, --password string Password to use for API authentication -s, --scheduler_addr string Aurora Scheduler's address. -i, --skipCertVerification Skip CA certificate hostname verification. + -t, --timeout duration Gorealis timeout. (default 20s) --toJSON Print output in JSON format. -u, --username string Username to use for API authentication -z, --zookeeper string Zookeeper node(s) where Aurora stores information. (comma separated list) @@ -39,4 +40,4 @@ australis stop update [update ID] [flags] * [australis stop](australis_stop.md) - Stop a service or maintenance on a host (DRAIN). -###### Auto generated by spf13/cobra on 7-May-2020 +###### Auto generated by spf13/cobra on 5-Nov-2020 diff --git a/internal/job.go b/internal/job.go index dcbf771..bdde546 100644 --- a/internal/job.go +++ b/internal/job.go @@ -47,6 +47,17 @@ type Container struct { Docker *DockerContainer `yaml:"docker"` } +type ValueConstraint struct { + Name string `yaml:"name"` + Values []string `yaml:"values"` + Negated bool `yaml:"negated"` +} + +type LimitConstraint struct { + Name string `yaml:"name"` + Limit int32 `yaml:"limit"` +} + type Job struct { Environment string `yaml:"environment"` Role string `yaml:"role"` @@ -64,6 +75,8 @@ type Job struct { Container *Container `yaml:"container,omitempty"` CronSchedule *string `yaml:"cronSchedule,omitempty"` CronCollisionPolicy *string `yaml:"cronCollisionPolicy,omitempty"` + ValueConstraints []ValueConstraint `yaml:"valueConstraints,flow,omitempty"` + LimitConstraints []LimitConstraint `yaml:"limitConstraints,flow,omitempty"` } func (j *Job) ToRealis() (*realis.AuroraJob, error) { @@ -125,6 +138,15 @@ func (j *Job) ToRealis() (*realis.AuroraJob, error) { } + // Setting Constraints + for _, valConstraint := range j.ValueConstraints { + auroraJob.AddValueConstraint(valConstraint.Name, valConstraint.Negated, valConstraint.Values...) + } + + for _, limit := range j.LimitConstraints { + auroraJob.AddLimitConstraint(limit.Name, limit.Limit) + } + return auroraJob, nil } @@ -162,6 +184,7 @@ func (j *Job) Validate() error { } return nil } + func (j *Job) ValidateCron() error { if j.CronSchedule == nil { return errors.New("cron schedule must be set") diff --git a/internal/util_test.go b/internal/util_test.go index 05cb686..366ffb0 100644 --- a/internal/util_test.go +++ b/internal/util_test.go @@ -25,6 +25,11 @@ func TestUnmarshalJob(t *testing.T) { assert.NoError(t, err) } +func TestUnmarshalDedicatedJob(t *testing.T) { + _, err := UnmarshalJob("../test/hello_world_dedicated.yaml") + assert.NoError(t, err) +} + func TestUnmarshalCron(t *testing.T) { cron, err := UnmarshalJob("../test/hello_world_cron.yaml") assert.NoError(t, err) @@ -35,4 +40,3 @@ func TestUnmarshalUpdate(t *testing.T) { _, err := UnmarshalUpdate("../test/update_hello_world.yaml") assert.NoError(t, err) } - diff --git a/test/hello_world_dedicated.yaml b/test/hello_world_dedicated.yaml new file mode 100644 index 0000000..95dac27 --- /dev/null +++ b/test/hello_world_dedicated.yaml @@ -0,0 +1,30 @@ +--- +environment: "prod" +role: "vagrant" +name: "hello_world" +cpu: 0.09 +ram: 64 +disk: 128 +instances: 1 +valueConstraints: + - name: "dedicated" + values: + - "vagrant/bar" +thermos: + - name: "bootstrap" + cmd: "echo bootstrapping" + - name: "hello_gorealis" + cmd: "while true; do echo hello world from gorealis; sleep 10; done" +updateSettings: + maxPerInstanceFailures: 1 + maxFailedInstances: 1 + minTimeInRunning: 1m + rollbackOnFailure: true + instanceRanges: + - start: 1 + end: 4 + blockIfNoPulseAfter: 1m + slaAware: false + strategy: + name: Batch + groupSize: 2 \ No newline at end of file