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

Improve example files handling in examples scripts #182

Closed
a-bouth opened this issue Dec 3, 2024 · 0 comments · Fixed by #193
Closed

Improve example files handling in examples scripts #182

a-bouth opened this issue Dec 3, 2024 · 0 comments · Fixed by #193
Labels
enhancement New features or code improvements

Comments

@a-bouth
Copy link
Collaborator

a-bouth commented Dec 3, 2024

📝 Description of the feature

Currently we're using:

        # In case of CI/CD pipelines
        port_in_env = os.environ.get("ANSRV_DPF_SOUND_PORT")
        if port_in_env is not None:
            return "C:\\data\\" + filename
        else:
            return local_path

In the file download.py in _download_file

This is not optimal as we're using an hardcoded path (which only makes sense for the specific case of build pipelines), and an environment variable This download function should not use/depend of the environment variable (which should be used only for build pipelines).

💡 Steps for implementing the feature

  1. Modify the signature of _download_file (and functions that call it) to add an argument which is the server : _download_file(filename, directory=None, _test=False, server)`
  2. Use the function dpf.upload_file inside _download_file to upload the file to the server
  3. Return the path returned by dpf.upload_file
  4. Make sure all examples are working in setups with and without docker container

🔗 Useful links and references

dpf.upload_file

@a-bouth a-bouth added the enhancement New features or code improvements label Dec 3, 2024
@anshlachamb anshlachamb linked a pull request Dec 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features or code improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant