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

Pass in env vars in FlyteRemote register_script #2120

Merged
merged 2 commits into from
Jan 22, 2024

Conversation

knordstrom-muon
Copy link
Contributor

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

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.

Copy link

welcome bot commented Jan 19, 2024

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>
Copy link

codecov bot commented Jan 19, 2024

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
84 checks passed
Copy link

welcome bot commented Jan 22, 2024

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

@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
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
3 participants