task-maker-rust icon indicating copy to clipboard operation
task-maker-rust copied to clipboard

Command to export a task to a self-contained tar file

Open veluca93 opened this issue 3 years ago • 7 comments

veluca93 avatar May 01 '22 11:05 veluca93

Can you explain what do you mean more precisely? I think I know where this can be useful, but I'd like to know what files should be included in this package.

cc: @cairomassimo

edomora97 avatar May 14 '22 17:05 edomora97

Basically, "whatever is in the list of inputs of the DAG" is at least a reasonable first approximation (assuming those files are sufficient for rebuilding the DAG)

veluca93 avatar May 14 '22 17:05 veluca93

I guess also task.yaml, the attachments and the "external" symlinks resolved.

edomora97 avatar May 15 '22 16:05 edomora97

We are giving up on running problems "from the Git source" on the UI server. (We can still have a pipeline to run a problem from a given Git commit, just it won't be on the UI server.) So, we need a new format to represent a problem on the server. The simplest option is a tar file containing the problem directory, with these requirements:

  • it's self-contained (i.e., no symlink pointing outside the folder),
  • it's possible to run task-maker in the extracted tar, with the same effect as running it from the source directory,
  • no inputs and outputs in the tar (there's the cache for that),
  • (nice to have) after extracting the tar, all the files pointed-to from the task metadata are already in place: statement, attachments, task-info.json (this avoids the need of running another command later on the server to generate said files),
  • (nice to have) deterministic, i.e., creating the tar a second time in the same directory will generate byte-to-byte exactly the same file.

cairomassimo avatar May 17 '22 10:05 cairomassimo

My 2c: generated files such as statements should not be in that bundle -- so that if the generation process improves, one can re-trigger it without actually importing again the task and/or creating a new version.

veluca93 avatar May 17 '22 10:05 veluca93

generated files such as statements should not be in that bundle

Ok, no problem with that. On the server we can run:

  • task-maker non-existent-solution to generate the statements, and
  • task-maker-tools task-info to generate the metadata.

We will need LaTeX installed on the UI server, but I'm assuming that won't be an issue.

cairomassimo avatar May 17 '22 11:05 cairomassimo

BTW, if we don't want to generate any extra file, then a command like task-maker-tools ls-files, which simply lists the files used by task-maker, would be enough. We can resolve external symlinks and tar the files after that.

cairomassimo avatar May 17 '22 11:05 cairomassimo