whole-tale / girder_wholetale

Girder plugin providing basic Whole Tale functionality
BSD 3-Clause "New" or "Revised" License
3 stars 5 forks source link

Reoder ops in finalizeInstance so that /authorize can do its job #491

Closed Xarthisius closed 3 years ago

Xarthisius commented 3 years ago

Problem

It takes 30s for instances run on a deployments with FQDN to be accessible, which happens to correspond to the timeout of _wait_for_server. What we're doing is roughly:

  1. spawn job finish -> let's check if container is up to update instance
  2. check if instance exists based on containerInfo.name (for 30s)
  3. no matter what happens in 2. carry on
  4. set the containerInfo.name on instance (oops we need it in 2.)

Approach

It's possible to frontload the operation of setting necessary info on the instance object, before we start hitting authorize endpoint

How to test?

  1. Deploy in a place using FQDN (like .stage.wholetale.org)
  2. Confirm that instances "launch" faster.
  3. It can be also confirm by inspecting girder info.log. Prior to this change you should see:
    [2021-05-27 14:24:16,770] INFO: Booting server at [...url...], getting HTTP status [404]    # a bunch of those
    [2021-05-27 14:24:17,965] INFO: Booting server at [...url...], getting HTTP status [403]    # a bunch of those

    afterwards there should be no messages with 403 error.

NOTE: I was patching it live on .stage, so prolly best to restart girder container.

codecov[bot] commented 3 years ago

Codecov Report

Merging #491 (a62fb9f) into master (65e8639) will increase coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #491   +/-   ##
=======================================
  Coverage   93.17%   93.18%           
=======================================
  Files          52       52           
  Lines        3958     3960    +2     
=======================================
+ Hits         3688     3690    +2     
  Misses        270      270           
Impacted Files Coverage Δ
server/models/instance.py 86.58% <100.00%> (+0.16%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 65e8639...a62fb9f. Read the comment docs.