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

Adds api for library usage #434

Closed
wants to merge 15 commits into from
Closed

Adds api for library usage #434

wants to merge 15 commits into from

Conversation

codefromthecrypt
Copy link
Contributor

@codefromthecrypt codefromthecrypt commented Oct 28, 2022

This is a sketch. A real impl will need to test things, similar to our e2e test. Particularly there could be some tricky things for example, how to signal close since the envoy run will block the calling thread. This is mainly to show that the api approach should be precise and only expose top-level concepts that relevant to import.

Fixes: #433

Signed-off-by: Adrian Cole <[email protected]>
Copy link
Contributor Author

@codefromthecrypt codefromthecrypt left a comment

Choose a reason for hiding this comment

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

added notes on how to proceed

api/run.go Show resolved Hide resolved
api/run.go Show resolved Hide resolved
api/run.go Show resolved Hide resolved
api/run.go Outdated Show resolved Hide resolved
Signed-off-by: Arko Dasgupta <[email protected]>
Signed-off-by: Arko Dasgupta <[email protected]>
@arkodg arkodg marked this pull request as ready for review October 28, 2022 22:44
@codefromthecrypt
Copy link
Contributor Author

protip. we have some infrastructure that allows unit testing w/o remote download deps

something like..

homeDir := t.TempDir()
envoyVersion := version.LastKnownEnvoy
versionsServer := test.RequireEnvoyVersionsTestServer(t, envoyVersion)
defer versionsServer.Close()
envoyVersionsURL := versionsServer.URL + "/envoy-versions.json"
out := new(bytes.Buffer)

... now use em

Signed-off-by: Arko Dasgupta <[email protected]>
Signed-off-by: Arko Dasgupta <[email protected]>
@arkodg
Copy link
Contributor

arkodg commented Oct 29, 2022

looks like the value in https://github.com/tetratelabs/func-e/blob/master/internal/version/last_known_envoy.txt is causing the CI to fail

@codefromthecrypt
Copy link
Contributor Author

seems thing haven't been maintained in a while. I ran the 1.23.1 tag on archive-envoy and then raised this to move to it #435

Signed-off-by: Arko Dasgupta <[email protected]>
Signed-off-by: Arko Dasgupta <[email protected]>
Signed-off-by: Arko Dasgupta <[email protected]>
Signed-off-by: Arko Dasgupta <[email protected]>
@arkodg
Copy link
Contributor

arkodg commented Oct 31, 2022

getting this error on windows

--- FAIL: TestRun (5.79s)
[162](https://github.com/tetratelabs/func-e/actions/runs/3364779609/jobs/5579526006#step:6:163)
    testing.go:1090: TempDir RemoveAll cleanup: remove C:\Users\RUNNER~1\AppData\Local\Temp\TestRun607085353\001\runs\1667250752759535200\stderr.log: The process cannot access the file because it is being used by another process.

@codefromthecrypt any idea why that might be happening ?

Copy link
Contributor Author

@codefromthecrypt codefromthecrypt left a comment

Choose a reason for hiding this comment

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

added some thoughts, noting that windows concerns are a big reason why the e2e directory has some custom runner code, and also that we have things like moreos

api/run.go Outdated Show resolved Hide resolved
api/run_test.go Outdated Show resolved Hide resolved
Signed-off-by: Arko Dasgupta <[email protected]>
@RoeiGanor
Copy link

Hey !
I love the idea of the this pull request and I would like to know what is the status of this PR. Is it possible to use funce in this method and if so, how?

@arkodg
Copy link
Contributor

arkodg commented Jan 12, 2023

Hey @mathetake can you ptal ( since @codefromthecrypt is a co-author ) ?

@codefromthecrypt
Copy link
Contributor Author

Since it isn't obvious to everyone why I closed this. Here's why.

This repo has no stale bot. Things dead without impact for several months should be closed. Anyone who is motivated and can do a decent job in execution can carry it forward. However, I'm not going to hold that up and have closed all PRs on all repos that have been dead for periods of 6 months or longer.

arkodg added a commit that referenced this pull request Aug 9, 2023
* Define an api that allows go projects to use func-e as a library

Takes #434 forward

Fixes: #433

Signed-off-by: Arko Dasgupta <[email protected]>
arkodg added a commit that referenced this pull request Aug 9, 2023
* Define an api that allows go projects to use func-e as a library

Takes #434 forward

Fixes: #433

Signed-off-by: Arko Dasgupta <[email protected]>
arkodg added a commit that referenced this pull request Aug 22, 2024
* Allow downstream projects to import func-e

* Define an api that allows go projects to use func-e as a library

Takes #434 forward

Fixes: #433

Signed-off-by: Arko Dasgupta <[email protected]>

* add another test to improve coverage

Signed-off-by: Arko Dasgupta <[email protected]>

---------

Signed-off-by: Arko Dasgupta <[email protected]>
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.

Allow downstream projects to programmatically run envoy
3 participants