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

feat: Cache workspace blob on tofu-controller filesystem #1182

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yitsushi
Copy link
Collaborator

@yitsushi yitsushi commented Jan 22, 2024

  • block stream encryption + remove non-stream endpoint
  • Nothing uses the feature yet.
❯ kubectl exec -it -n flux-system chart-tofu-controller-648fbc54f8-7sprc -- ls -la /blob-cache/
total 12
drwxrwsrwx    2 root     1337          4096 Dec 19 15:29 .
drwxr-xr-x    1 root     root          4096 Dec 19 15:29 ..
-rw-r--r--    1 controll 1337           800 Dec 20 09:41 terraform-helloworld-tf-priv.tar.gz

❯ kubectl exec -it -n flux-system chart-tofu-controller-648fbc54f8-7sprc -- hexdump -C /blob-cache/terraform-helloworld-tf-priv.tar.gz | head -n 3
00000000  1b 3f 00 8d 25 67 17 79  87 04 d7 b9 03 f2 6c ba  |.?..%g.y......l.|
00000010  bc 0c 7e 75 29 de 25 1f  bb 99 c4 49 2d 99 1b e0  |..~u).%....I-...|
00000020  b3 72 2f ca ab fb 5f 93  ee b4 ba bd a6 76 83 38  |.r/..._......v.8|

with a small go temp app, after decryption and untar (the repo itself has only one file: main.tf):

❯ kubectl cp -n flux-system chart-tofu-controller-648fbc54f8-7sprc:/blob-cache/terraform-helloworld-tf-priv.tar.gz ./terraform-helloworld-tf-priv.tar.gz
tar: removing leading '/' from member names

❯ go run .
INFO[0000] /tmp/1417200660

❯ tree /tmp/1417200660
/tmp/1417200660
├── backend_override.tf
├── generated.auto.tfvars.json
└── main.tf

1 directory, 3 files

Extra To Do items:

  • Add feature flag

@yitsushi yitsushi force-pushed the 1157-cache-blob-filesystem branch 3 times, most recently from 4937d9a to a7f7b50 Compare January 22, 2024 21:59
@yitsushi yitsushi force-pushed the 1157-cache-blob-filesystem branch 2 times, most recently from 0d9e1e9 to 46741fc Compare February 5, 2024 17:11
@yitsushi yitsushi force-pushed the 1157-cache-blob-filesystem branch 2 times, most recently from 085dc22 to e9973fa Compare February 28, 2024 18:47
- block stream encryption + remove non-stream endpoint
- Nothing uses the feature yet.

```
❯ kubectl exec -it -n flux-system chart-tofu-controller-648fbc54f8-7sprc -- ls -la /blob-cache/
total 12
drwxrwsrwx    2 root     1337          4096 Dec 19 15:29 .
drwxr-xr-x    1 root     root          4096 Dec 19 15:29 ..
-rw-r--r--    1 controll 1337           800 Dec 20 09:41 terraform-helloworld-tf-priv.tar.gz

❯ kubectl exec -it -n flux-system chart-tofu-controller-648fbc54f8-7sprc -- hexdump -C /blob-cache/terraform-helloworld-tf-priv.tar.gz | head -n 3
00000000  1b 3f 00 8d 25 67 17 79  87 04 d7 b9 03 f2 6c ba  |.?..%g.y......l.|
00000010  bc 0c 7e 75 29 de 25 1f  bb 99 c4 49 2d 99 1b e0  |..~u).%....I-...|
00000020  b3 72 2f ca ab fb 5f 93  ee b4 ba bd a6 76 83 38  |.r/..._......v.8|
```

with a small go temp app, after decryption and untar (the repo itself
has only one file: `main.tf`):
```
❯ kubectl cp -n flux-system chart-tofu-controller-648fbc54f8-7sprc:/blob-cache/terraform-helloworld-tf-priv.tar.gz ./terraform-helloworld-tf-priv.tar.gz
tar: removing leading '/' from member names

❯ go run .
INFO[0000] /tmp/1417200660

❯ tree /tmp/1417200660
/tmp/1417200660
├── backend_override.tf
├── generated.auto.tfvars.json
└── main.tf

1 directory, 3 files
```

Extra To Do items:
- Add feature flag

Signed-off-by: Balazs Nadasdi <[email protected]>
Signed-off-by: Victoria Nadasdi <[email protected]>
@yitsushi yitsushi changed the title feat: Cache workspace blob on tf-controller filesystem feat: Cache workspace blob on tofu-controller filesystem Feb 28, 2024
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.

1 participant