Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Gokart Feature Discussion: What's read_environ()

Gokart Feature Discussion: What's read_environ()


Keisuke OGAKI

February 10, 2022

More Decks by Keisuke OGAKI

Other Decks in Programming


  1. Gokart Feature Discussion What's read_environ()

  2. Let’s use luigi-style ${envvar}

  3. OK. But why gokart works without special interpolation???

  4. Default values of ALL sections!!!

  5. So? (cfg.ini) [foo] BAR=%(ENV)s [TaskOnKart] [foo] BAR=%(ENV)s ENV=foo [TaskOnKart] ENV=foo

    [foo] BAR=foo ENV=foo [TaskOnKart] ENV=foo basic variable interpolation envvars to default ENV=foo CONFIG=cfg.ini python main.py
  6. Problems Sideeffect • [TaskOnKart] ENV=foo is not intended arguments ◦

    Creating [s3] section triggers errors by inserting ALL envvars from your env to s3client • Although some products use this sideeffect (backward compatibility problem) ◦ COMMON_PARAM=3 python main.py [TaskA] a=1 [TaskB] b=2 TaskA(a=1, common_param=3) TaskB(b=2, common_param=3)
  7. Conclusion Though this breaks backward compatibility, this much less readable.

    So let’s reconstruct this. How much backward compatibility will be broken? • poor: retain current • better: not default, but %(envvar)s works ◦ current PR • best: just use ${envvar}