Skip to content

Show warning that --yolo, --concurrency and --rpp fields are valid for executortype poolmgr only #2971

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

Merged
merged 6 commits into from
Jul 8, 2024

Conversation

soharab-ic
Copy link
Contributor

@soharab-ic soharab-ic commented Jun 26, 2024

Description

  • --yolo, --concurrency and --rpp fields are only valid for executortype poolmgr only.
  • Show warning to users if these field are used with other executortype.
  • Update CLI --help page with this information.

Which issue(s) this PR fixes:

Fixes #

Testing

$ fission fn create --help
Create a function (and optionally, an HTTP route to it)

Options:
  --concurrency=500 (--con)             Maximum number of pods specialized concurrently to serve
                                        requests (Only valid for executortype; `poolmgr`)
  --requestsperpod=1 (--rpp)            Maximum number of concurrent requests that can be served by a
                                        specialized pod (Only valid for executortype; `poolmgr`)
  --onceonly=false (--yolo)             Specifies if specialized pod will serve exactly one request in
                                        its lifetime (Only valid for executortype; `poolmgr`)
$ fission fn create --name hello-yolo --env go-120 --src hello.go --entrypoint Handler --executortype newdeploy --yolo
Warning: --onceonly is only valid for executortype; `poolmgr`. Check `fission function create --help`
Package 'hello-yolo-1f035d38-7351-420c-9f2f-6cb4251e7e54' created
function 'hello-yolo' created
$ fission fn create --name hello-yolo --env go-120 --src hello.go --entrypoint Handler --yolo
Package 'hello-yolo-c9a9ec72-dff5-457e-aaf4-834a11c0b0a7' created
function 'hello-yolo' created
$ fission fn create --name hello-pool --env go-120 --src hello.go --entrypoint Handler --executortype newdeploy --rpp 1
Warning: --requestsperpod is only valid for executortype; `poolmgr`. Check `fission function create --help`
Package 'hello-pool-4977f1c0-49e9-43f5-9662-54f735960d5c' created
function 'hello-pool' created
$ fission fn create --name hello-pool --env go-120 --src hello.go --entrypoint Handler --rpp 1
Package 'hello-pool-7425b8d6-1ac5-4155-b5db-2e82fc586e81' created
function 'hello-pool' created
$ fission fn create --name hello-con --env go-120 --src hello.go --entrypoint Handler --executortype newdeploy --concurrency 1
Warning: --concurrency is only valid for executortype; `poolmgr`. Check `fission function create --help`
Package 'hello-con-aeaa4cf7-b1bc-4ed4-8ce3-ef4fa0bea3ea' created
function 'hello-con' created
$ fission fn create --name hello-con --env go-120 --src hello.go --entrypoint Handler --concurrency 1
Package 'hello-con-36d32155-d0fe-4b0c-b95b-3109ee0be5bd' created
function 'hello-con' created
$ fission fn create --name hello-newdeploy --env go-120 --src hello.go --entrypoint Handler --executortype newdeploy
Package 'hello-newdeploy-96b0182b-afe9-4dd6-ab58-72923f734591' created
function 'hello-newdeploy' created

$ fission fn update --name hello-newdeploy --con 1 --rpp 1 --yolo
Warning: --concurrency is only valid for executortype; `poolmgr`. Check `fission function create --help`
Warning: --requestsperpod is only valid for executortype; `poolmgr`. Check `fission function create --help`
Warning: --onceonly is only valid for executortype; `poolmgr`. Check `fission function create --help`
Function 'hello-newdeploy' updated

Checklist:

  • I ran tests as well as code linting locally to verify my changes.
  • I have done manual verification of my changes, changes working as expected.
  • I have added new tests to cover my changes.
  • My changes follow contributing guidelines of Fission.
  • I have signed all of my commits.

…e poolmgr

```
Show warning if these fields are used with other executortype.
Update CLI with this information.
```

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
Copy link

codecov bot commented Jun 26, 2024

Codecov Report

Attention: Patch coverage is 37.93103% with 18 lines in your changes missing coverage. Please review.

Project coverage is 44.70%. Comparing base (f2baa17) to head (c46f77f).

Files Patch % Lines
pkg/fission-cli/cmd/function/create.go 40.00% 10 Missing and 5 partials ⚠️
pkg/fission-cli/cmd/function/update.go 25.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2971   +/-   ##
=======================================
  Coverage   44.69%   44.70%           
=======================================
  Files         236      236           
  Lines       24277    24306   +29     
=======================================
+ Hits        10851    10865   +14     
- Misses      12022    12032   +10     
- Partials     1404     1409    +5     
Flag Coverage Δ
unittests 44.70% <37.93%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@soharab-ic soharab-ic requested a review from sanketsudake June 26, 2024 09:46
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
…dy created newdeploy function.

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
@sanketsudake sanketsudake merged commit c6c811e into main Jul 8, 2024
10 checks passed
@sanketsudake sanketsudake deleted the cli-fix branch September 26, 2024 16:17
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.

2 participants