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

Synchronizer entrypoint doesn't pick cli flags #254

Open
gdurandvadas opened this issue Nov 16, 2023 · 3 comments
Open

Synchronizer entrypoint doesn't pick cli flags #254

gdurandvadas opened this issue Nov 16, 2023 · 3 comments

Comments

@gdurandvadas
Copy link

When running Synchronizer on Docker you can't send the cli flags

flags := &CliFlags{
		ConfigFile:             flag.String("config", "", "a configuration file"),
		WriteDefaultConfigFile: flag.String("write-default-config", "", "write a default configuration file"),
		VersionInfo:            flag.Bool("version", false, "Print the version"),
		RawConfig:              MakeCliArgMapFor(definition),
	}

If I pass an argument to the container as per documentation, it doesn't work as expected

docker run splitsoftware/split-synchronizer -version
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

     __      ____        _ _ _
    / /__   / ___| _ __ | (_) |_
   / / \ \  \___ \| '_ \| | | __|
   \ \  \ \  ___) | |_) | | | |_
    \_\ / / |____/| .__/|_|_|\__|
       /_/        |_|



Split Synchronizer - Version: 5.4.2 (2fbf91c)
Split-Sync - ERROR - 2023/11/13 14:21:41 main.go:73: Failed to initialize the split sync:  initialization error: error parsing client key from provided SDK key: apikey too short

If I overwrite the entrypoint and run the command with arguments, it does work

docker run --entrypoint /bin/bash splitsoftware/split-synchronizer -c "split-sync -version"
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

     __      ____        _ _ _
    / /__   / ___| _ __ | (_) |_
   / / \ \  \___ \| '_ \| | | __|
   \ \  \ \  ___) | |_) | | | |_
    \_\ / / |____/| .__/|_|_|\__|
       /_/        |_|



Split Synchronizer - Version: 5.4.2 (2fbf91c)
@mmelograno
Copy link
Contributor

Hi @gdurandvadas,

Might I ask what is the purpose and use case of using cli instead of using environment variables example - confs?

docker run --rm --name split-synchronizer \
 -p 3010:3010 \
 -e SPLIT_SYNC_APIKEY="your-sdk-key" \
 -e SPLIT_SYNC_REDIS_HOST=<your-redis-host> \
 -e SPLIT_SYNC_REDIS_PORT=<your_redis_port> \
 splitsoftware/split-synchronizer

Thanks,
Matias

@gdurandvadas
Copy link
Author

Hello @mmelograno,

I know the EVNs will work, but this is more of a workaround for my setup since I prefer to manipulate a JSON file than nested string arguments.
On the other hand, the bug is still there if files are not being loaded. I would prefer it if you fixed it or updated the documentation if the feature is not meant to be supported.

Thanks!

@mredolatti
Copy link
Contributor

hi @gdurandvadas, sorry you're having issues with our tool. As @mmelograno mentioned before, our image is meant to be used with environment variables as the primary interface, and the binary inside is built for AMD64 architecture.

If you want to use a JSON file instead you have 2 options:
approach A:
build your own image (you can grab a pre-built binary from https://downloads.split.io/synchronizer/downloads.sync.html) and package it with the custom JSON you want to use (and reference it by adding -config=<your_file> to your entrypoint arguments.

approach B:
use our image with the following extra steps:

  1. add a mount a volume within a specific path in the image when doing docker run (or mountVolume in a kubernetes deployment)
  2. override the existing entrypoint like you did, passing -config=</<mount_path>/<your_file.json>

please let us know if you're still having issues.
thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants