-
Notifications
You must be signed in to change notification settings - Fork 137
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
[Extensibility] Compilation errors #71
Conversation
And, when used here, --> agent/src/protocols/nessie/discovery_handler.rs:35:17
|
35 | self.discovery_handler_config.nessie_url,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| expected `&str`, found struct `std::string::String`
| help: consider borrowing here: `&self.discovery_handler_config.nessie_url` Fixes? d7567b5 |
--> agent/src/protocols/nessie/discovery_handler.rs:36:17
|
36 | props,
| ^^^^^ expected struct `std::string::String`, found `&str`
|
= note: expected struct `std::collections::HashMap<std::string::String, _>`
found struct `std::collections::HashMap<&str, _>`
Fixes? 76ddab1 |
Fixed: f818015 |
Cargo.toml
Outdated
members = ["shared", "controller", "agent", "samples/brokers/udev-video-broker", "samples/brokers/nessie" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it would be helpful to include actual Nessie code? We have resisted and kept it as a doc sample up to now, but it would be interesting to hear the other side of that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we aren't including the Nessie source code, this probably shouldn't be included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One advantage in having the example as code is that you can run it through the CI tool and ensure it builds.
The disadvantage is in needing to chop it up to form the documentation.
There must (!?) be something akin to a Jupyter notebook that can comprise build/run-able code and Markdown as comments that can be rendered on-the-fly as a tutorial.
In this case, the documentation omits this change and, as a result, nessie.rs
does not get auto-generated from the proto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally agree with everything you said. 100%.
If we are going to keep this as an md-based how-to, we need to find a way to validate the code changes (and keep them in sync).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validating the changes easily would be a really nice to have.
Since this addition is needed to auto-generate the code, @DazWilkin, could you add a step to the extensibility doc to add nessie to the Cargo.toml
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kate-goldenring I realized that your Dockerfile
adds ./samples/brokers/nessie
to members
for the build to succeed.
So, the developer could either add the project to Cargo.toml
?
Or they could cd ./samples/brokers/nessie && cargo build
to generate it (while developing).
Do you have a preference? I'll then add.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since anyone doing this will have to build a new agent as well, it seems like adding nessie to the /Cargo.toml's member list makes the most sense.
Another issue with extensibility.md: This line:
should read (tonic will generate nessie.rs based on the proto file and build.rs):
|
Another issue: nessie needs to be added to the list of oneOf items in deployment/helm/crds/akri-configuration-crd.yaml: oneOf:
- required: ["nessie"] # <--- add this line
- required: ["debugEcho"]
- required: ["onvif"]``` |
There is probably a more kuberentes-appropriate way to do this, but for the broker pod to have access to an external site, I had to add brokerPodSpec:
hostNetwork: true # <----
containers:
- name: nessie-broker |
Assuming the developer creates !samples/brokers/nessie
!shared/ Addressed: 011f3c8 |
The
Propose: b46aa11 |
I made some other changes to enable SSL from our agent and nessie in Dockerfile.nessie and Dockerfile.agent: |
I did not have to do this (using MicroK8s)... This may be a constraint with K3s? |
With these changes from @bfjelds, I'm now working. However, I was receiving image pull errors for private (!) The documentation Install akri with newly built containers considers the need to provide I think the correct location for apiVersion: akri.sh/v0
kind: Configuration
metadata:
name: nessie
spec:
protocol:
nessie:
nessieUrl: https://www.lochness.co.uk/livecam/img/lochness.jpg
capacity: 5
brokerPodSpec:
imagePullSecrets:
- name: <your-secret-name>
containers:
- name: nessie-broker
image: "ghcr.io/<your-github-alias>/nessie:latest"
resources:
limits:
"{{PLACEHOLDER}}": "1"
instanceServiceSpec:
ports:
- name: grpc
port: 80
targetPort: 8083
configurationServiceSpec:
ports:
- name: grpc
port: 80
targetPort: 8083 |
I still seem to need it for MicroK8s. Maybe I have something else going on ... will need to investigate. |
Perhaps this? If you're using a corporate host, it may be more secure than your average (e.g. my) installation. |
Seems a likely cuplrit. Let's get this PR polished off with what works for you, we can add comments later about corporate hosts. It seems like this PR is almost there as far as getting Nessie as buttoned up as it can be, just need to update the code with what you have working and swap out the changes in .dockerignore and Cargo.toml for md descriptions of those changes, right? |
Yes, I think almost everything is represented in the PR 😁 While you're looking through it, containerizing the gRPC implementation could be improved; e.g. where should the Dockerfile be created? I put it in the repo root but I think it belongs in deployment? I had to clone the Helm chart to test the changes on my GCE instance but that should work from your Helm chart once your changes are in. I'm willing to clean slate and work through it again once you have everything in place. |
if we were checking in code changes for nessie (rather than it being md-only), i'd say putting the Dockerfile in but i think it is simpler to suggest creating the Dockerfile with the nessie broker code ( if you could remove the changes to once the PR is merged, i will start working on the next round of fixes for Nessie (which will include adding notes to extensibility.md about the changes needed in .dockerignore and Cargo.toml). sound good? |
My naive approach to "remove changes" is to add more changes undoing them; hope OK? 49ce0a8 |
Perfect! |
* public struct && public field? * Wants `&str` rather than `String` * Fix: mismatched types * Include "Nessie" in `Cargo.toml' for `build.rs` * Required for `HashMap` * Explain gRPC build and correct `nessie_service.rs` * Dockerfile * .dockerignore changes for Nessie * Fix links * Two writes (sic.) to undo a commit
What this PR does / why we need it:
I'm encountering some issues building Nessie and suspect the majority are my noob errors.
However, I suspect
nessie_url
should be (a) public fieldSpecial notes for your reviewer:
If applicable:
cargo fmt
)cargo build
)cargo clippy
)cargo test
)cargo doc
)./version.sh
)