Skip to content

Pass in env vars in FlyteRemote register_script#2120

Merged
pingsutw merged 2 commits into
flyteorg:masterfrom
knordstrom-muon:envs_in_register_script
Jan 22, 2024
Merged

Pass in env vars in FlyteRemote register_script#2120
pingsutw merged 2 commits into
flyteorg:masterfrom
knordstrom-muon:envs_in_register_script

Conversation

@knordstrom-muon

@knordstrom-muon knordstrom-muon commented Jan 19, 2024

Copy link
Copy Markdown
Contributor

Why are the changes needed?

The FlyteRemote.register_script function is useful for registering local code to remote during integration tests of workflows. It does not allow the user to pass in environment variables to the serialization though, even though it should be easy to support this.

What changes were proposed in this pull request?

Make it possible to pass in environment variables using a dict[str,str] which can be passed directly to SerializationSettings.

How was this patch tested?

Don't think register_script is covered by unit tests at the moment.

@welcome

welcome Bot commented Jan 19, 2024

Copy link
Copy Markdown

Thank you for opening this pull request! 🙌

These tips will help get your PR across the finish line:

  • Most of the repos have a PR template; if not, fill it out to the best of your knowledge.
  • Sign off your commits (Reference: DCO Guide).

…ter_script

Signed-off-by: Karl Nordstrom <karl.n@muonspace.com>
Signed-off-by: Karl Nordstrom <karl.n@muonspace.com>
@knordstrom-muon knordstrom-muon force-pushed the envs_in_register_script branch from a3074f3 to a4facf0 Compare January 19, 2024 18:32
@codecov

codecov Bot commented Jan 19, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (475eecd) 85.78% compared to head (a4facf0) 85.78%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2120   +/-   ##
=======================================
  Coverage   85.78%   85.78%           
=======================================
  Files         313      313           
  Lines       23525    23525           
  Branches     3517     3517           
=======================================
  Hits        20182    20182           
  Misses       2734     2734           
  Partials      609      609           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pingsutw pingsutw merged commit 5ba545c into flyteorg:master Jan 22, 2024
@welcome

welcome Bot commented Jan 22, 2024

Copy link
Copy Markdown

Congrats on merging your first pull request! 🎉

@knordstrom-muon knordstrom-muon deleted the envs_in_register_script branch January 22, 2024 18:58
@nineunderground

Copy link
Copy Markdown

@knordstrom-muon Sorry, just a quick validation from myself, but this is an implementation only valid for "pyflyte register", but not using "flytectl register". Am I right?
I just checked with latest 1.10.3 and it it is like that to me. With that being said, and If I am correct, is it possible to replicate for flytectl tool?

@knordstrom-muon

Copy link
Copy Markdown
Contributor Author

Hi @nineunderground -- I am not using this with pyflyte or flytectl but with flytekit.remote directly (so in python code). To achieve the same thing with the CLIs, I have in the past used:

pyflyte serialize ... --env ENV_VAR=TEST ...
flytectl register files ...

So I think in your case, you could achieve it with flytectl register but you would still need pyflyte to serialize first.

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