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

feat: add the ability to get and set env vars in a batch way across devices and fleets #21

Merged
merged 1 commit into from
May 14, 2024

Conversation

rayozzie
Copy link
Contributor

@rayozzie rayozzie commented May 14, 2024

I also added a -pretty so that the json objects output by these commands can be visually pleasing.

// Get the env vars for various scopes, returning a JSON object containing them

notehub -product net.ozzie.ray:t -pretty -scope fleet:60379c1da2401609b8e1fb3eec2a186e -get-vars

notehub -product net.ozzie.ray:t -pretty -scope dev:864475040518622 -get-vars

notehub -product net.ozzie.ray:t -pretty -scope "Ray's Fleet" -get-vars

notehub -product net.ozzie.ray:t -pretty -scope "@ray's Fleet" -get-vars

// Get the env vars for a list of fleets stored in a file, returning a JSON object containing them

fleets.txt:
Ray's Fleet
fleet:60379c1da2401609b8e1fb3eec2a186e

notehub -product net.ozzie.ray:t -pretty -scope @fleets.txt -get-vars

// Get the env vars for a list of devices stored in a file, returning a JSON object containing them

devices.txt:
@ray's Fleet
dev:864475040518622

notehub -product net.ozzie.ray:t -pretty -scope @devices.txt -get-vars -pretty

// Set one env vars and remove one using a template directly on the command line

notehub -product net.ozzie.ray:t -pretty -scope "@ray's Fleet" -set-vars '{"var1":"val1","var2":"-"}'

// Set env vars through a file-based template

notehub -product net.ozzie.ray:t -pretty -scope "@ray's Fleet" -set-vars @template

…evices and fleets

I also added a -pretty so that the json objects output by these commands can be visually pleasing.

// Get the env vars for various scopes, returning a JSON object containing them
notehub -product net.ozzie.ray:t -pretty -scope fleet:60379c1da2401609b8e1fb3eec2a186e -get-vars
notehub -product net.ozzie.ray:t -pretty -scope dev:864475040518622 -get-vars
notehub -product net.ozzie.ray:t -pretty -scope "Ray's Fleet" -get-vars
notehub -product net.ozzie.ray:t -pretty -scope "@ray's Fleet" -get-vars

// Get the env vars for a list of fleets stored in a file, returning a JSON object containing them
fleets.txt
	Ray's Fleet
	fleet:60379c1da2401609b8e1fb3eec2a186e
notehub -product net.ozzie.ray:t -pretty -scope @fleets.txt -get-vars

// Get the env vars for a list of devices stored in a file, returning a JSON object containing them
devices.txt
	@ray's Fleet
	dev:864475040518622
notehub -product net.ozzie.ray:t -pretty -scope @devices.txt -get-vars -pretty

// Set one env vars and remove one using a template directly on the command line
notehub -product net.ozzie.ray:t -pretty -scope "@ray's Fleet" -set-vars '{"var1":"val1","var2":"-"}'

// Set env vars through a file-based template
notehub -product net.ozzie.ray:t -pretty -scope "@ray's Fleet" -set-vars @template
@rayozzie rayozzie merged commit 212443f into master May 14, 2024
@zfields zfields deleted the ray/env-vars branch May 14, 2024 22:15
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

Successfully merging this pull request may close these issues.

1 participant