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

Add earl jobs export that creates tjm file #3695

Closed
godber opened this issue Jul 23, 2024 · 4 comments
Closed

Add earl jobs export that creates tjm file #3695

godber opened this issue Jul 23, 2024 · 4 comments

Comments

@godber
Copy link
Member

godber commented Jul 23, 2024

This earl jobs ts-tmp1 <JOBID> to a file.json that is compatible with tjm.

@busma13
Copy link
Contributor

busma13 commented Jul 25, 2024

This seems similar to earl jobs save. We could default to saving in the .teraslice directory like it does and provide the same options if they are applicable.

@busma13 busma13 self-assigned this Aug 9, 2024
@busma13
Copy link
Contributor

busma13 commented Aug 9, 2024

If we want this command to be able to export multiple jobs, then it would be nice to have the file names come from some default, so the user doesn't have to provide a name for every file. This could simply be the name property from the job config. It could possibly be helpful to include the cluster alias and the date in the file name.

If we only want to support exporting one job file at a time we can simply pass the name we want as an argument to the command.

@busma13
Copy link
Contributor

busma13 commented Aug 9, 2024

Current setup:

  • job file saves to ~/.teraslice/export/<clusterAlias>/<jobConfig.name>.json by default
  • pass --export-dir flag to save to a different directory
  • pass --file-name or -f to save under a different name
  • if exporting multiple job files file-names are assigned to job_ids based on their order
➜  teraslice git:(earl-tjm-export) ✗ earl jobs export local 382b41df-588e-4df6-ab0d-42f063a629f2 9988d547-aee3-4872-932b-b1a0c688f500 --export-dir ./config/test --file-name test382b.json test9988.json

➜  teraslice git:(earl-tjm-export) ✗ ls ./config/test
test382b.json test9988.json

@busma13
Copy link
Contributor

busma13 commented Aug 9, 2024

TBD:

  • do we want to support passing all as a job_id? If so we would want to disable the --file-name option in that case.
  • status option?

godber pushed a commit that referenced this issue Sep 10, 2024
This PR makes the following changes:
- Add `jobs export` command to teraslice-cli
- Creates a `Jobs` class using the provided jobIds, extracts the
jobConfig for each job, and saves each config to the local file system.
- Each job is saved to `./<job.name>.json` by default. If a file name
already exists `-N` will be appended to the file name.
- `--outdir` flag will set a custom directory where job files are saved.
- A job-id of `all` will export all jobs. This can be combined with
`--status` to export all jobs with executions of a specific status.

Ref: #3695
@busma13 busma13 closed this as completed Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants