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

[STABLE] Fix job file stageout interruptibility #110

Merged
merged 2 commits into from
Apr 10, 2015

Conversation

natefoo
Copy link
Member

@natefoo natefoo commented Apr 10, 2015

The job files api is used by Pulsar when Pulsar is configured to initiate staging operations on the remote end. Without the upload module, restarting processes while a stageout is occurring can result in job failure (or possibly retrying the stageout from the beginning, a costly operation when the file is large).

Additionally, the staged out files are moved from their temporary received paths to their final destinations. This prevents the temporary space from growing excessively large and also causes the move to be instantaneous source and destination are on the same filesystem.

Here is the corresponding nginx config:

location /_job_files {
    # Pass non-stageouts directly to the API method
    if ($request_method != POST) {
        rewrite "" /api/jobs/$arg_job_id/files last;
    }
    upload_store /galaxy/upload_job_files;
    upload_store_access user:rw; # group:rw all:rw;
    upload_pass_form_field "";
    upload_set_form_field "__${upload_field_name}_path" "$upload_tmp_path";
    upload_pass_args on;
    upload_pass /_upload_job_files_done;
}

location /_upload_job_files_done {
    internal;
    rewrite "" /api/jobs/$arg_job_id/files;
}

The nginx config should work if you have set the following in galaxy.ini:

nginx_upload_job_files_store = /galaxy/upload_job_files
nginx_upload_job_files_path = /_job_files

Despite the warnings on IfIsEvil, this use of if in the nginx config appears to be safe.

Related trello card: https://trello.com/c/usD7jzcT

natefoo added 2 commits April 10, 2015 15:29
api. Moving is a rename when the source and destination are on the same
filesystem, which is nearly instantaneous and greatly reduces the
possibility for failure due to mid-copy restarts.
@blankenberg
Copy link
Member

👍

@jmchilton
Copy link
Member

Fix - huh? I think you may be pulling a Blankenberg :).

Nonetheless 👍

jmchilton added a commit that referenced this pull request Apr 10, 2015
[STABLE] Fix job file stageout interruptibility
@jmchilton jmchilton merged commit 1b922ea into galaxyproject:release_15.03 Apr 10, 2015
@natefoo
Copy link
Member Author

natefoo commented Apr 10, 2015

Fix - huh? I think you may be pulling a Blankenberg :).

Shhhhhh.

@blankenberg
Copy link
Member

Hey, wait, I uh...ok..

@@ -342,7 +342,12 @@ def get_client( self, job_destination_params, job_id, env=[] ):

encoded_job_id = self.app.security.encode_id(job_id)
job_key = self.app.security.encode_id( job_id, kind="jobs_files" )
files_endpoint = "%s/api/jobs/%s/files?job_key=%s" % (
endpoint_base = "%s/api/jobs/%s?job_key=%s"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We broke non-nginx uploads here. The files got lost in the endpoint description.

jmchilton added a commit to jmchilton/galaxy that referenced this pull request May 5, 2015
natefoo added a commit to natefoo/galaxy that referenced this pull request May 6, 2015
mvdbeek pushed a commit to mvdbeek/galaxy that referenced this pull request Jan 24, 2017
Rename input_ids and output_ids Workflow attributes to source_ids and sink_ids respectively
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.

3 participants