Skip to content

Commit

Permalink
scripts: amend local multi-cluster deployment to '--override-backends…
Browse files Browse the repository at this point in the history
…' and more

Signed-off-by: Alex Aizman <[email protected]>
  • Loading branch information
alex-aizman committed Oct 26, 2022
1 parent 5d49219 commit 5d846fc
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 21 deletions.
4 changes: 2 additions & 2 deletions ais/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type (
ntargets int // expected number of targets in a starting-up cluster
skipStartup bool // determines if primary should skip waiting for targets to join
}
transient bool // false: make cmn.ConfigCLI settings permanent, true: leave them transient
transient bool // true: keep command-line provided `-config-custom` settings in memory only
overrideBackends bool // if true primary will metasync backends from deployment-time plain-text config
target struct {
// do not try to auto-join cluster upon startup - stand by and wait for admin request
Expand Down Expand Up @@ -90,7 +90,7 @@ func init() {
flag.StringVar(&daemon.cli.confCustom, "config_custom", "",
"\"key1=value1,key2=value2\" formatted string to override selected entries in config")
flag.BoolVar(&daemon.cli.transient, "transient", false,
"false: store customized (via config_custom) configuration\ntrue: runtime only (non-persistent)")
"false: store customized (via '-config_custom') configuration\ntrue: keep '-config_custom' settings in memory only (non-persistent)")
flag.BoolVar(&daemon.cli.usage, "h", false, "show usage and exit")
flag.BoolVar(&daemon.cli.overrideBackends, "override_backends", false, "configure remote backends at deployment time (potentially, override previously stored configuration)")

Expand Down
4 changes: 4 additions & 0 deletions api/env/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
*/
package env

// See also:
// - cmn/debug/debug_on.go for the list off all package names, including `fs` etc. (comment below)
// - docs/development.md for user guide and examples

const (
MODE = "MODE" // e.g., MODE=debug make deploy ...
DEBUG = "AIS_DEBUG" // e.g., AIS_DEBUG="fs=4,reb=4,transport=1" make deploy ...
Expand Down
51 changes: 32 additions & 19 deletions deploy/scripts/clean_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,34 @@ USAGE:
./clean_deploy.sh [options...]
OPTIONS:
--target-cnt Number of targets to start (default: 5)
--proxy-cnt Number of proxies to start (default: 5)
--mountpath-cnt Number of mountpaths to use (default: 5)
--cleanup Perform cleanup of data and metadata
--deployment Choose which AIS cluster to deploy. One of: 'local', 'remote', 'all' (default: 'local')
--remote-alias Alias to assign to the remote cluster (default: 'rmtais')
--aws Builds support for aws as a backend provider
--azure Builds support for azure as a backend provider
--gcp Builds support for gcp as a backend provider
--hdfs Builds support for hdfs as a backend provider
--loopback Loopback device size, e.g. 10G, 100M (default: 0). Zero size means: no loopbacks.
--dir The root directory of the aistore repository
--debug Change the logging level of particular package(s)
--https Start cluster with HTTPS enabled
-h, --help Show this help text
--target-cnt Number of target nodes in the cluster (default: 5)
--proxy-cnt Number of proxies/gateways (default: 5)
--mountpath-cnt Number of mountpaths (default: 5)
--cleanup Cleanup data and metadata from the previous deployments
--deployment Choose which AIS cluster(s) to deploy, one of: 'local', 'remote', 'all' (default: 'local')
--remote-alias Alias to assign to the remote cluster (default: 'rmtais')
--aws Support AWS S3 backend (i.e., build \`aisnode\` executable with AWS S3 SDK)
--gcp Support Google Cloud Platform (i.e., build \`aisnode\` with libraries to access GCP)
--azure Support Azure Cloud (experimental)
--hdfs Support HDFS as a backend provider (experimental)
--loopback Loopback device size, e.g. 10G, 100M (default: 0). Zero size means: no loopbacks.
--dir The root directory of the aistore repository
--debug Change the logging level of a specific package or packages
--https Use HTTPS
--override_backends Configure remote backends at deployment time (override previously stored backend configuration)
--standby When starting up, do not join cluster - wait instead for admin request (advanced usage, target-only)
--transient Do not store config changes, keep all the updates in memory
-h, --help Show this help text
"

# NOTE: `AIS_USE_HTTPS`, and all other system environment variables
# are listed in the `env` package:
# NOTE: `AIS_USE_HTTPS` and other system environment variables are listed in the `env` package:
# https://github.com/NVIDIA/aistore/blob/master/api/env/README.md

export MODE="debug" # By default start in debug mode
# NOTE: debug build with assertions compiled in (not to confuse with `AIS_DEBUG` tracing verbosity)
export MODE="debug"

# NOTE: additional `aisnode` command-line (run `aisnode --help`)
export RUN_ARGS=""

while (( "$#" )); do
case "${1}" in
Expand All @@ -82,13 +88,19 @@ while (( "$#" )); do
--proxy-cnt) proxy_cnt=$2; shift; shift;;
--mountpath-cnt) mountpath_cnt=$2; shift; shift;;
--cleanup) cleanup="true"; shift;;
--transient) RUN_ARGS="$RUN_ARGS -transient"; shift;;
--standby) RUN_ARGS="$RUN_ARGS -standby"; shift;;
--override_backends) RUN_ARGS="$RUN_ARGS -override_backends"; shift;;
--override-backends) RUN_ARGS="$RUN_ARGS -override_backends"; shift;;
--https)
export AIS_USE_HTTPS="true"
export AIS_SKIP_VERIFY_CRT="true"
export AIS_SERVER_CRT="${AIS_SERVER_CRT:$HOME/localhost.crt}"
export AIS_SERVER_KEY="${AIS_SERVER_KEY:$HOME/localhost.key}"
shift
;;
-*) RUN_ARGS="$RUN_ARGS ${1}"; shift;; ## NOTE: catch-all here assumes that everything that falls through the switch is binary

*) echo "fatal: unknown argument '${1}'"; exit 1;;
esac
done
Expand All @@ -110,7 +122,8 @@ if [[ ${cleanup} == "true" ]]; then
fi

if [[ ${deployment} == "local" || ${deployment} == "all" ]]; then
echo -e "${target_cnt}\n${proxy_cnt}\n${mountpath_cnt}\n${aws_provider}\n${gcp_provider}\n${azure_provider}\n${hdfs_provider}\n${loopback}\n" | make deploy
echo -e "${target_cnt}\n${proxy_cnt}\n${mountpath_cnt}\n${aws_provider}\n${gcp_provider}\n${azure_provider}\n${hdfs_provider}\n${loopback}\n" |\
make deploy "RUN_ARGS=${RUN_ARGS}"
fi

make -j8 authn aisloader aisfs cli 1>/dev/null # Build binaries in parallel
Expand Down
2 changes: 2 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ A cluster deployed in `debug` mode will produce a log like this:
As this only enables general debug asserts and logs it is also possible to enable verbose logging per package.
To do that deploy cluster with eg. `AIS_DEBUG="fs=4,reb=4"` what means that packages `fs` and `reb` will have logging level set to `4` (generally used for verbose logging).

> See `cmn/debug/debug_on.go` for the list off all package names, including `fs` and `reb` mentioned above.
## Scripts

There is a growing number of scripts and useful commands that can be used in development.
Expand Down

0 comments on commit 5d846fc

Please sign in to comment.