-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: add fake-gcs-server to devstack with GCS integration tests #3155
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
base: master
Are you sure you want to change the base?
Changes from 3 commits
d5841a5
ad38c14
5bd7225
ed157d8
3b78d1f
97a6ca9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| load('./_result.tiltfile', 'new_result') | ||
|
|
||
| def setup_fake_gcs_server(ctx): | ||
| k8s_yaml(read_file('./tilt/k8s/fake-gcs-server.yaml')) | ||
| k8s_yaml(read_file('./tilt/k8s/gcs-bucket-init-job.yaml')) | ||
| k8s_yaml(read_file('./tilt/k8s/fake-gcs-secret.yaml')) | ||
|
|
||
| k8s_resource( | ||
| 'fake-gcs-server', | ||
| port_forwards=['4443:4443'], | ||
| links=[link('http://localhost:4443/storage/v1/b', 'fake-gcs-server buckets')], | ||
| labels=['fake-gcs-server'], | ||
| ) | ||
|
|
||
| k8s_resource('gcs-bucket-init', resource_deps=['fake-gcs-server'], labels=['fake-gcs-server']) | ||
|
|
||
| return new_result( | ||
| config={"METAFLOW_DATASTORE_SYSROOT_GS": "gs://metaflow-test/metaflow"}, | ||
| shell_env={"STORAGE_EMULATOR_HOST": "http://localhost:4443"}, | ||
| config_resources=['gcs-bucket-init'], | ||
| k8s_secrets=['fake-gcs-secret'], | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: fake-gcs-secret | ||
| type: Opaque | ||
| stringData: | ||
| STORAGE_EMULATOR_HOST: http://fake-gcs-server:4443 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: fake-gcs-server | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app: fake-gcs-server | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: fake-gcs-server | ||
| spec: | ||
| containers: | ||
| - name: fake-gcs-server | ||
| image: fsouza/fake-gcs-server:latest | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| # Port 4443 is the fake-gcs-server default; we keep it for | ||
| # compatibility even though we use -scheme http (not HTTPS). | ||
| args: ["-scheme", "http", "-host", "0.0.0.0", "-port", "4443"] | ||
| ports: | ||
| - containerPort: 4443 | ||
| resources: | ||
| requests: | ||
| cpu: 50m | ||
| memory: 64Mi | ||
| limits: | ||
| cpu: 200m | ||
| memory: 128Mi | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: fake-gcs-server | ||
| spec: | ||
| selector: | ||
| app: fake-gcs-server | ||
| ports: | ||
| - port: 4443 | ||
| targetPort: 4443 | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,27 @@ | ||||||||||||||||||||||||||||||||||||||||
| apiVersion: batch/v1 | ||||||||||||||||||||||||||||||||||||||||
| kind: Job | ||||||||||||||||||||||||||||||||||||||||
| metadata: | ||||||||||||||||||||||||||||||||||||||||
| name: gcs-bucket-init | ||||||||||||||||||||||||||||||||||||||||
| spec: | ||||||||||||||||||||||||||||||||||||||||
| ttlSecondsAfterFinished: 120 | ||||||||||||||||||||||||||||||||||||||||
| template: | ||||||||||||||||||||||||||||||||||||||||
| spec: | ||||||||||||||||||||||||||||||||||||||||
| restartPolicy: OnFailure | ||||||||||||||||||||||||||||||||||||||||
| containers: | ||||||||||||||||||||||||||||||||||||||||
| - name: init | ||||||||||||||||||||||||||||||||||||||||
| image: curlimages/curl:latest | ||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||||||||||
| command: ["/bin/sh", "-ec"] | ||||||||||||||||||||||||||||||||||||||||
| args: | ||||||||||||||||||||||||||||||||||||||||
| - | | ||||||||||||||||||||||||||||||||||||||||
| curl -sf -X POST \ | ||||||||||||||||||||||||||||||||||||||||
| http://fake-gcs-server:4443/storage/v1/b \ | ||||||||||||||||||||||||||||||||||||||||
| -H "Content-Type: application/json" \ | ||||||||||||||||||||||||||||||||||||||||
| -d '{"name":"metaflow-test"}' | ||||||||||||||||||||||||||||||||||||||||
| echo "Bucket 'metaflow-test' created successfully" | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+12
to
+20
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
With
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
| resources: | ||||||||||||||||||||||||||||||||||||||||
| requests: | ||||||||||||||||||||||||||||||||||||||||
| cpu: 25m | ||||||||||||||||||||||||||||||||||||||||
| memory: 32Mi | ||||||||||||||||||||||||||||||||||||||||
| limits: | ||||||||||||||||||||||||||||||||||||||||
| cpu: 100m | ||||||||||||||||||||||||||||||||||||||||
| memory: 64Mi | ||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.