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

add xclbin URI support #1140

Merged
merged 16 commits into from
Aug 10, 2022
Merged

add xclbin URI support #1140

merged 16 commits into from
Aug 10, 2022

Conversation

timsnyder-siv
Copy link
Collaborator

@timsnyder-siv timsnyder-siv commented Jul 18, 2022

use fsspec to enable xclbin's to be one of any URI protocol
supported by the library or an installed add-on

Related PRs / Issues

UI / API Impact

Enables xclbin in hwdb to be a URI supported by fsspec

Verilog / AGFI Compatibility

No impact to Verilog or AGFI.

Contributor Checklist

  • Is this PR's title suitable for inclusion in the changelog and have you added a changelog:<topic> label?
  • Did you add Scaladoc/docstring/doxygen to every public function/method?
  • Update the docs with
    • list of protocols tested and known to work
    • pointer to fsspec config that can be used to inject auth stuff (TO ALL CALLS). Since the auth args go to all calls when using the fsspec level config, it won't work in all cases but it might be useful as we start to use things and determine if/how we want to add features to the manager to specify auth. In the limit, you might need different auth for every file you interact with but you don't want to have to repeat and maintain auth everywhere. Just brainstorming, it seems like fsspec should allow it's config to do URI pattern matching to provide auth.
  • Did you add at least one test demonstrating the PR?
  • Add a test for ssh:// in Add a test for ssh: fsspec URI #1167
  • Did you delete any extraneous prints/debugging code?
  • Did you state the UI / API impact?
  • Did you specify the Verilog / AGFI compatibility impact?
  • If applicable, did you regenerate and publicly share default AGFIs?
  • If applicable, did you apply the ci:fpga-deploy label?
  • If applicable, did you apply the Please Backport label?

Reviewer Checklist (only modified by reviewer)

  • Is the title suitable for inclusion in the changelog and does the PR have a changelog:<topic> label?
  • Did you mark the proper release milestone?
  • Did you check whether all relevant Contributor checkboxes have been checked?

use fsspec to enable xclbin's to be one of any URI protocol
supported by the library or an installed add-on
@timsnyder-siv timsnyder-siv added the changelog:added Put PR title in 'Added' section of changelog label Jul 18, 2022
@timsnyder-siv
Copy link
Collaborator Author

I haven't tested this at all yet but I wanted to get this PR open and share it with others to throw stones.

Copy link
Contributor

@abejgonzalez abejgonzalez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems pretty good to me so far minus some small nits.

deploy/runtools/runtime_config.py Show resolved Hide resolved
deploy/runtools/run_farm_deploy_managers.py Outdated Show resolved Hide resolved
deploy/runtools/run_farm_deploy_managers.py Outdated Show resolved Hide resolved
deploy/runtools/run_farm_deploy_managers.py Outdated Show resolved Hide resolved
deploy/runtools/run_farm_deploy_managers.py Outdated Show resolved Hide resolved
deploy/runtools/run_farm_deploy_managers.py Outdated Show resolved Hide resolved
deploy/runtools/run_farm_deploy_managers.py Outdated Show resolved Hide resolved
deploy/runtools/run_farm_deploy_managers.py Outdated Show resolved Hide resolved
deploy/runtools/run_farm_deploy_managers.py Show resolved Hide resolved
deploy/runtools/run_farm_deploy_managers.py Outdated Show resolved Hide resolved
deploy/runtools/run_farm_deploy_managers.py Outdated Show resolved Hide resolved
deploy/runtools/runtime_config.py Show resolved Hide resolved
@timsnyder-siv
Copy link
Collaborator Author

I have some more commits that I want to push to this after rebasing on top of the fixed pytests (because they weren't really broken by this stuff)

@timsnyder-siv
Copy link
Collaborator Author

I updated the checklist with the remaining tasks for this PR to be ready to merge.

@timsnyder-siv timsnyder-siv changed the title xclbin URI support add xclbin URI support Jul 30, 2022
@timsnyder-siv timsnyder-siv mentioned this pull request Aug 4, 2022
12 tasks
refactor `localize_xclbin` from the Vitis runner to `util.io.downloadURI()` and add some pytests
Comment on lines +16 to +17
('s3',Path("tests/s3_test_download_json.json")),
('file',Path("tests/file_test_download_json.json")),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to add a test for ssh? The simplest way to do it would be to spin up a docker container that the test would try to pull things out of with ssh. If docker isn't installed, the test would be skipped.

Alternately, we write a test for this that utilizes the multiple hosts in CI. Or we could do both so that devs can test this locally (if they have docker installed) and we have a test in CI without having to install docker in the place where we're running pytests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't we just test this by running localhost for the "it should work" case and some invalid IP for the "it shouldn't work" case? I'm not sure it's worth having docker installed for such a small test

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abejgonzalez how do we differentiate whether someone doesn't have sshd configured correctly on localhost vs the test actually working? I don't like having a dependency into sshd that the tests aren't actually controling the configuration for.

A lighter-weight option could be for a test fixture to spin up a Paramiko sshd on a non-system port or use something like this gist. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems better to me.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've asked @filipstamenkovic-sifive to help me add a test.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Captured in #1167 for followup. I'd like to go ahead and get this merged if the CI passes this time.

Copy link
Contributor

@filipstamenkovic-sifive filipstamenkovic-sifive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timsnyder-siv adding a few suggestions to fix the test issue in CI.

deploy/tests/test_utils.py Outdated Show resolved Hide resolved
scripts/machine-launch-script.sh Show resolved Hide resolved
deploy/util/io.py Outdated Show resolved Hide resolved
timsnyder-siv and others added 2 commits August 9, 2022 14:14
awstools.py now depends on it via util.io
Co-authored-by: Abraham Gonzalez <[email protected]>
Copy link
Contributor

@abejgonzalez abejgonzalez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Pending all CI passing.

@timsnyder-siv timsnyder-siv enabled auto-merge (squash) August 9, 2022 22:40
auto-merge was automatically disabled August 10, 2022 14:30

Pull request was closed

@timsnyder-siv timsnyder-siv reopened this Aug 10, 2022
@timsnyder-siv timsnyder-siv merged commit a517b19 into main Aug 10, 2022
@timsnyder-siv timsnyder-siv deleted the fsspec_for_bitstream branch August 10, 2022 21:00
timsnyder-siv added a commit that referenced this pull request Aug 16, 2022
@timsnyder-siv timsnyder-siv added changelog:omit Do not include this PR in the changelog and removed changelog:added Put PR title in 'Added' section of changelog labels Aug 16, 2022
timsnyder-siv added a commit that referenced this pull request Aug 16, 2022
@abejgonzalez abejgonzalez restored the fsspec_for_bitstream branch January 28, 2023 01:33
hwcfg.local_xclbin = './local.xclbin'

with cd(remote_sim_dir):
run(downloadURI, hwcfg.xclbin, hwcfg.local_xclbin)
Copy link
Contributor

@sifive-benjamin-morse sifive-benjamin-morse Feb 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my testing, this line doesn't execute. run() only accepts a string, which is a shell command, not a function. The 2nd and 3rd arguments are booleans, not arguments to the first function. Am I on the wrong version of fabric or something? https://github.com/fabric/fabric/blob/1.14/fabric/operations.py#L970

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we meant execute() instead of run().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:omit Do not include this PR in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants