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

fix: tf-gcp wrong path for cloud functions #6230

Merged
merged 4 commits into from
Apr 17, 2024
Merged

fix: tf-gcp wrong path for cloud functions #6230

merged 4 commits into from
Apr 17, 2024

Conversation

MarkMcCulloh
Copy link
Contributor

Fixes #6229

Also removed a duplicate part of the bundling API.

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

@MarkMcCulloh MarkMcCulloh requested a review from a team as a code owner April 13, 2024 20:29
Copy link

Thanks for opening this pull request! 🎉
Please consult the contributing guidelines for details on how to contribute to this project.
If you need any assistence, don't hesitate to ping the relevant owner over Slack.

Topic Owner
Wing SDK and utility APIs @chriscbr
Wing Console @ainvoner, @skyrpex, @polamoros
JSON, structs, primitives and collections @hasanaburayyan
Platforms and plugins @hasanaburayyan
Frontend resources (website, react, etc) @tsuf239
Language design @chriscbr
VSCode extension and language server @markmcculloh
Compiler architecture, inflights, lifting @yoav-steinberg
Wing Testing Framework @tsuf239
Wing CLI @markmcculloh
Build system, dev environment, releases @markmcculloh
Library Ecosystem @chriscbr
Documentation @hasanaburayyan
SDK test suite @tsuf239
Examples @hasanaburayyan
Wing Playground @eladcon

@monadabot
Copy link
Contributor

monadabot commented Apr 13, 2024

Console preview environment is available at https://wing-console-pr-6230.fly.dev 🚀

Last Updated (UTC) 2024-04-15 13:35

@monadabot
Copy link
Contributor

monadabot commented Apr 13, 2024

Benchmarks

Comparison to Baseline ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
Benchmark Before After Change
version 58ms±0.47 59ms±0.78 +1ms (+2.2%)⬜
functions_1.test.w -t sim 406ms±23.75 393ms±5.08 -13ms (-3.23%)⬜
functions_1.test.w -t tf-aws 815ms±4.26 823ms±5.57 +8ms (+0.93%)⬜
hello_world.test.w -t sim 394ms±6.73 403ms±11.44 +9ms (+2.26%)⬜
hello_world.test.w -t tf-aws 1507ms±14.94 1515ms±18.84 +8ms (+0.51%)⬜
jsii_big.test.w -t sim 2780ms±13.25 2786ms±10.32 +6ms (+0.21%)⬜
jsii_big.test.w -t tf-aws 3013ms±14.08 3010ms±15.42 -3ms (-0.1%)⬜
functions_10.test.w -t sim 483ms±7.29 486ms±7.63 +3ms (+0.61%)⬜
functions_10.test.w -t tf-aws 1999ms±8.38 2007ms±9.53 +8ms (+0.41%)⬜
jsii_small.test.w -t sim 364ms±4.16 371ms±4.36 +7ms (+1.91%)⬜
jsii_small.test.w -t tf-aws 599ms±5.63 606ms±3.51 +7ms (+1.22%)⬜
empty.test.w -t sim 356ms±3.24 362ms±4.85 +6ms (+1.74%)⬜
empty.test.w -t tf-aws 591ms±11.09 597ms±4.28 +5ms (+0.9%)⬜

⬜ Within 1.5 standard deviations
🟩 Faster, Above 1.5 standard deviations
🟥 Slower, Above 1.5 standard deviations

Benchmarks may vary outside of normal expectations, especially when running in GitHub Actions CI.

Results
name mean min max moe sd
version 59ms 58ms 62ms 1ms 1ms
functions_1.test.w -t sim 393ms 380ms 408ms 5ms 7ms
functions_1.test.w -t tf-aws 823ms 811ms 832ms 6ms 8ms
hello_world.test.w -t sim 403ms 390ms 440ms 11ms 16ms
hello_world.test.w -t tf-aws 1515ms 1489ms 1580ms 19ms 26ms
jsii_big.test.w -t sim 2786ms 2765ms 2817ms 10ms 14ms
jsii_big.test.w -t tf-aws 3010ms 2981ms 3044ms 15ms 22ms
functions_10.test.w -t sim 486ms 460ms 495ms 8ms 11ms
functions_10.test.w -t tf-aws 2007ms 1978ms 2025ms 10ms 13ms
jsii_small.test.w -t sim 371ms 360ms 379ms 4ms 6ms
jsii_small.test.w -t tf-aws 606ms 601ms 618ms 4ms 5ms
empty.test.w -t sim 362ms 355ms 374ms 5ms 7ms
empty.test.w -t tf-aws 597ms 589ms 607ms 4ms 6ms
Last Updated (UTC) 2024-04-15 13:39

eladb
eladb previously requested changes Apr 14, 2024
Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

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

Missing test

@garysassano
Copy link
Collaborator

garysassano commented Apr 14, 2024

cloud.Bucket

Show test results
Results:
    ✓ bucket/aws-bucket.test.w
    ✓ bucket/get.test.w
    ✓ bucket/add_object.test.w
    ✓ bucket/try_get_json.test.w
    ✓ bucket/rename.test.w
    ✓ bucket/exists.test.w
    ✓ bucket/metadata.test.w
    ✓ bucket/add_file.test.w
    ✓ bucket/bucket_list.test.w
    ✓ bucket/put_json.test.w
    ✓ bucket/try_delete.test.w
    ✓ bucket/public_url.test.w
    ✓ bucket/try_get.test.w
    ✓ bucket/delete.test.w
    ✓ bucket/put.test.w
    ✓ bucket/copy.test.w
    ✓ bucket/load_test.test.w
    × bucket/signed_url.test.w
    ? bucket/events.test.w

Errors:
At bucket/signed_url.test.w
Error: Error while invoking the function handler-c808b553:
Permission 'iam.serviceAccounts.signBlob' denied on resource (or it may not exist).
    at FunctionClient._invokeLocally (/home/user/github/wing/libs/wingsdk/lib/shared-gcp/function.inflight.js:31:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async FunctionClient.invokeWithLogs (/home/user/github/wing/libs/wingsdk/lib/shared-gcp/function.inflight.js:75:17)
    at async TestRunnerClient.runTest (/home/user/github/wing/libs/wingsdk/lib/shared-gcp/test-runner.inflight.js:32:41)
    at async runTestsWithRetry (/home/user/github/wing/apps/wing/dist/commands/test/test.js:276:28)
    at async withSpinner (/home/user/github/wing/apps/wing/dist/util.js:58:24)
    at async testTf (/home/user/github/wing/apps/wing/dist/commands/test/test.js:453:25)
    at async testOne (/home/user/github/wing/apps/wing/dist/commands/test/test.js:152:19)
    at async testFile (/home/user/github/wing/apps/wing/dist/commands/test/test.js:98:39)
    at async Promise.all (index 15)
    at async Object.test (/home/user/github/wing/apps/wing/dist/commands/test/test.js:123:5)
    at async Command.<anonymous> (/home/user/github/wing/apps/wing/dist/cli.js:51:30)
At bucket/events.test.w
Error: onDelete method isn't implemented yet on the current target.
   --> examples/tests/sdk_tests/bucket/events.test.w:31:1
   | 
   | 
   | 
31 | b.onDelete(inflight (key: str) => {
   | ^
at /home/user/github/wing/examples/tests/sdk_tests/bucket/events.test.w:31:1

Tests 1 failed | 22 passed | 1 unsupported (24)
Snapshots 17 new | 2 skipped
Test Files 1 failed | 17 passed | 1 unsupported (19)
Duration 3m48.23s

cloud.Function

Show test results
Results:
    ✓ function/concurrency.test.w
    ✓ function/function-ref.test.w
    ✓ function/aws-function.test.w
    ✓ function/env.test.w
    ✓ function/memory_and_env.test.w
    ✓ function/logging.test.w
    × function/timeout.test.w
    × function/invoke.test.w
    ? function/invoke_async.test.w

Errors:
At function/timeout.test.w
Command failed: terraform destroy -auto-approve
╷
│ Error: "account_id" ("function-with-1s-timeou-c88cb37a") doesn't match regexp "^[a-z](?:[-a-z0-9]{4,28}[a-z0-9])$"

│   with google_service_account.Testis1fvmB_xE_env0_functionwith1stimeout_ServiceAccountc88cb37acc1d5f587d5827f7714542af889a521591_05812E4E,
│   on main.tf.json line 265, in resource.google_service_account.Testis1fvmB_xE_env0_functionwith1stimeout_ServiceAccountc88cb37acc1d5f587d5827f7714542af889a521591_05812E4E:
│  265:         "account_id": "function-with-1s-timeou-c88cb37a",



│ Error: "account_id" ("function-with-default-t-c8dc9b33") doesn't match regexp "^[a-z](?:[-a-z0-9]{4,28}[a-z0-9])$"
│ 
│   with google_service_account.Testis1fvmB_xE_env0_functionwithdefaulttimeout_ServiceAccountc8dc9b33353f08f5886258239a2af5c34bede9eb3c_94DFFDAC,
│   on main.tf.json line 275, in resource.google_service_account.Testis1fvmB_xE_env0_functionwithdefaulttimeout_ServiceAccountc8dc9b33353f08f5886258239a2af5c34bede9eb3c_94DFFDAC:
│  275:         "account_id": "function-with-default-t-c8dc9b33",
│ 
╵

At function/invoke.test.w
Error: Error while invoking the function handler-c8130c1c:
Error while invoking the function f2-c8e2444d:
Expected values to be strictly deep-equal:

'' !== undefined

    at FunctionClient._invokeLocally (/home/user/github/wing/libs/wingsdk/lib/shared-gcp/function.inflight.js:31:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async FunctionClient.invokeWithLogs (/home/user/github/wing/libs/wingsdk/lib/shared-gcp/function.inflight.js:75:17)
    at async TestRunnerClient.runTest (/home/user/github/wing/libs/wingsdk/lib/shared-gcp/test-runner.inflight.js:32:41)
    at async runTestsWithRetry (/home/user/github/wing/apps/wing/dist/commands/test/test.js:276:28)
    at async withSpinner (/home/user/github/wing/apps/wing/dist/util.js:58:24)
    at async testTf (/home/user/github/wing/apps/wing/dist/commands/test/test.js:453:25)
    at async testOne (/home/user/github/wing/apps/wing/dist/commands/test/test.js:152:19)
    at async testFile (/home/user/github/wing/apps/wing/dist/commands/test/test.js:98:39)
    at async Promise.all (index 4)
    at async Object.test (/home/user/github/wing/apps/wing/dist/commands/test/test.js:123:5)
    at async Command.<anonymous> (/home/user/github/wing/apps/wing/dist/cli.js:51:30)
At function/invoke_async.test.w
Error: Resource root/Test.ouUnqhFCpg/env1/Function does not support inflight operation invokeAsync.
It might not be implemented yet.

Tests 2 failed | 7 passed | 1 unsupported (10)
Snapshots 6 new | 3 skipped
Test Files 2 failed | 6 passed | 1 unsupported (9)
Duration 4m19.83s

cloud.Counter

Show test results
Results:
    ✓ counter/aws-counter.test.w
    ✓ counter/inc.test.w
    ✓ counter/peek.test.w
    ✓ counter/dec.test.w
    ✓ counter/set.test.w
    ✓ counter/initial.test.w

Tests 12 passed (12)
Snapshots 6 new
Test Files 6 passed (6)
Duration 2m55.88s

Copy link
Contributor

mergify bot commented Apr 17, 2024

Thanks for contributing, @MarkMcCulloh! This PR will now be added to the merge queue, or immediately merged if mark/fix-gcp-path is up-to-date with main and the queue is empty.

mergify bot added a commit that referenced this pull request Apr 17, 2024
@mergify mergify bot merged commit 719df34 into main Apr 17, 2024
15 checks passed
@mergify mergify bot deleted the mark/fix-gcp-path branch April 17, 2024 11:12
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.70.22.

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.

All tests fail for tf-gcp platform
5 participants