Is your feature request related to a problem? Please describe.
Sometimes we want to use neuro in bash-scripts or makefiles (ex. we want to run cpu-powered tests from ci). This use case requires us to submit a job, wait for it to finish, fetch logs and test if exit code was 0. It would be much more convenient if there were a single command to do this.
Describe the solution you'd like
An key to neuro submit or an alternative command which will wait for job to start, stream its logs and exit with the same exit code the job did.
I'd prefer a key (ex. --attach). Maybe even with an interactive variant in distant future.
Describe alternatives you've considered
Can be a separate command, but I don't think that it's reasonable to duplicate all of the submit logic.
Additional context
Currently It's possible to mimic similar behaviour with this shell-script:
neuro submit --http 8888 --gpu $(GPU) --memory $(MEMORY) --cpu $(CPU) -q \
--gpu-model $(GPU_MODEL) \
--volume $(CODE_FOLDER):/app:rw \
image:$(IMAGE_NAME) test > .job.id
neuro logs $$(cat .job.id)
neuro status $$(cat .job.id) | grep 'Status: succeeded' > /dev/null
rm .job.id
Is your feature request related to a problem? Please describe.
Sometimes we want to use neuro in bash-scripts or makefiles (ex. we want to run cpu-powered tests from ci). This use case requires us to submit a job, wait for it to finish, fetch logs and test if exit code was 0. It would be much more convenient if there were a single command to do this.
Describe the solution you'd like
An key to
neuro submitor an alternative command which will wait for job to start, stream its logs and exit with the same exit code the job did.I'd prefer a key (ex.
--attach). Maybe even with an interactive variant in distant future.Describe alternatives you've considered
Can be a separate command, but I don't think that it's reasonable to duplicate all of the submit logic.
Additional context
Currently It's possible to mimic similar behaviour with this shell-script: