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

Support of faasd and fix faas-netes issue #78

Merged
merged 1 commit into from
Oct 11, 2021

Conversation

nitishkumar71
Copy link
Member

@nitishkumar71 nitishkumar71 commented Sep 22, 2021

Signed-off-by: Nitishkumar Singh [email protected]

Certifier should support validation of faasd installation

Description

Motivation and Context

  • I have raised an issue to propose this change this is required

Closes #77 #60

How Has This Been Tested?

CI has been extended to test faasd installation along with openfaas in Kubernetes.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

Commits:

  • I've read the CONTRIBUTION guide
  • My commit message has a body and describes how this was tested and why it is required.
  • I have signed-off my commits with git commit -s for the Developer Certificate of Origin (DCO)

Code:

  • My code follows the code style of this project.
  • I have added tests to cover my changes.

Docs:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@alexellis
Copy link
Member

Hi @nitishkumar71 great to see the first version of this PR arriving :)

I'm not sure if we have the issue and PR template in this repository yet, but would you mind adding in some of those fields to your PR description?

@nitishkumar71
Copy link
Member Author

Done.

Sharing update w.r.t to pending work

  1. Logs test need to be changed/updated to support faasd
  2. Secrete Update test need to be rechecked for openfaas/faasd. The earlier test looked wrong, so had to update it but after the update, the k8 secret update is not working.
  3. New logic needs to be added to test faasd listing functions.

@nitishkumar71 nitishkumar71 force-pushed the enable_faasd_support branch 2 times, most recently from c565064 to d944271 Compare September 30, 2021 04:38
@derek
Copy link

derek bot commented Sep 30, 2021

Thank you for your contribution. I've just checked and your commit doesn't appear to be signed-off. That's something we need before your Pull Request can be merged. Please see our contributing guide.
Tip: if you only have one commit so far then run: git commit --amend --signoff and then git push --force.

@derek derek bot added the no-dco label Sep 30, 2021
@derek derek bot removed the no-dco label Sep 30, 2021
value = string(invoke(t, functionRequest, "", "", http.StatusOK))
if value != setValue {
t.Errorf("got %s, wanted %s", value, newValue)
if config.ProviderName == faasNetesProviderName {
Copy link
Member Author

@nitishkumar71 nitishkumar71 Sep 30, 2021

Choose a reason for hiding this comment

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

Since, secret update does not happen directly in kubernetes. we needed to scale down and up the function for secret update. As test function does not read updated secret.

@@ -62,7 +66,12 @@ func Test_ScaleFromZeroDuringInvoke(t *testing.T) {

defer deleteFunction(t, functionRequest)

scaleFunction(t, functionName, 0)
// scaleFunction(t, functionName, 0)
err := config.Client.ScaleFunction(context.Background(), functionName, config.DefaultNamespace, 0)
Copy link
Member Author

Choose a reason for hiding this comment

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

Have standardized the scaling approach

actual := strings.TrimLeft(msg.Text, "0123456789/: ")
if !strings.HasPrefix(actual, expected) {
t.Fatalf("got unexpected log message %q, expected %q", actual, expected)
if config.ProviderName != faasdProviderName {
Copy link
Member Author

Choose a reason for hiding this comment

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

Log Prefix for faasd does not comply with this. Hence skipped it.

Copy link
Member

Choose a reason for hiding this comment

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

what do the logs in faasd look like? can you document the difference here? maybe there is a way for us to normailze the test or even normalize the logs so that we can still test both?

Copy link
Member Author

Choose a reason for hiding this comment

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

2021-10-03T14:34:27Z 2021/10/03 14:34:27 Version: 0.18.8	SHA: 76e463a7a017f81ed88ae7824d2ef7a3f60ed45e
2021-10-03T14:34:27Z 2021/10/03 14:34:27 Timeouts: read: 5s, write: 5s hard: 0s.
2021-10-03T14:34:27Z 2021/10/03 14:34:27 Listening on port: 8080
2021-10-03T14:34:27Z 2021/10/03 14:34:27 Writing lock-file to: /tmp/.lock
2021-10-03T14:34:27Z 2021/10/03 14:34:27 Metrics listening on port: 8081
2021-10-03T14:34:27Z 2021/10/03 14:34:27 Forking fprocess.
2021-10-03T14:34:27Z 2021/10/03 14:34:27 Wrote 11 Bytes - Duration: 0.008953 seconds
2021-10-03T14:44:00Z 2021/10/03 14:44:00 SIGTERM received.. shutting down server in 5s
2021-10-03T14:44:00Z 2021/10/03 14:44:00 Removing lock-file : /tmp/.lock
2021-10-03T14:44:05Z 2021/10/03 14:44:05 No new connections allowed. Exiting in: 5

Copy link
Member

Choose a reason for hiding this comment

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

I guess if we add TZ- to the trim set, then then it will work this test

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps the test could become less picky and just look for the core detail:

strings.contains(output, Forking fprocess.)
strings.contains(output, Wrote 11 Bytes)

@nitishkumar71 nitishkumar71 changed the title [WIP] Support of faasd Support of faasd and fix faas-netes issue Sep 30, 2021
@nitishkumar71
Copy link
Member Author

nitishkumar71 commented Sep 30, 2021

@LucasRoesler @alexellis It's ready for review. I have added few comments to put more context around the code changed.

Copy link
Member

@LucasRoesler LucasRoesler left a comment

Choose a reason for hiding this comment

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

@nitishkumar71 just a few whitespace fixes and one thing about config, but it otherwise looks good.

Sorry I was a bit slow. I was travelling and originally thought I would be more available but a few things went a little wrong/sideways and I was pretty occupied.

Makefile Outdated Show resolved Hide resolved
contrib/clean_faasd.sh Outdated Show resolved Hide resolved
contrib/deploy_faasd.sh Outdated Show resolved Hide resolved
contrib/get_tools.sh Outdated Show resolved Hide resolved
tests/deploy_test.go Outdated Show resolved Hide resolved
actual := strings.TrimLeft(msg.Text, "0123456789/: ")
if !strings.HasPrefix(actual, expected) {
t.Fatalf("got unexpected log message %q, expected %q", actual, expected)
if config.ProviderName != faasdProviderName {
Copy link
Member

Choose a reason for hiding this comment

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

what do the logs in faasd look like? can you document the difference here? maybe there is a way for us to normailze the test or even normalize the logs so that we can still test both?

tests/main_test.go Outdated Show resolved Hide resolved
.github/workflows/test.yaml Outdated Show resolved Hide resolved
@derek
Copy link

derek bot commented Oct 3, 2021

Thank you for your contribution. I've just checked and your commit doesn't appear to be signed-off. That's something we need before your Pull Request can be merged. Please see our contributing guide.
Tip: if you only have one commit so far then run: git commit --amend --signoff and then git push --force.

@derek derek bot added the no-dco label Oct 3, 2021
@derek derek bot removed the no-dco label Oct 3, 2021
@nitishkumar71
Copy link
Member Author

nitishkumar71 commented Oct 6, 2021

Based on our discussion, have made changes in log test to validate the result.

Don't have permission to re-run these jobs on this repo but the success results for the same commit are recorded in the fork.
https://github.com/nitishkumar71/certifier/actions/runs/1313071634

@alexellis
Copy link
Member

If we can fix faas-netes, maybe it can be done in a separate PR?

Signed-off-by: Nitishkumar Singh <[email protected]>

Apply suggestions from code review

Co-authored-by: Lucas Roesler <[email protected]>

Changes for registry provider

Signed-off-by: Nitishkumar Singh <[email protected]>

Log comparision strategy changed

Signed-off-by: Nitishkumar Singh <[email protected]>

included 5 seconds dealy in log test

Signed-off-by: Nitishkumar Singh <[email protected]>

increased waiting time to 30 seconds

Signed-off-by: Nitishkumar Singh <[email protected]>
@LucasRoesler
Copy link
Member

@nitishkumar71 i can't tell what you changed to get it passing, it is the 30 second sleep?

@nitishkumar71
Copy link
Member Author

@nitishkumar71 i can't tell what you changed to get it passing, it is the 30 second sleep?

Yes

@LucasRoesler
Copy link
Member

It is a bit blunt, but let's start with something that works and iterate 👍

@LucasRoesler LucasRoesler merged commit e5e2de0 into openfaas:master Oct 11, 2021
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.

Add support for faasd
3 participants