-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: Iff940d1ac77c88786751fabdc8b609dad444bb43
- Loading branch information
1 parent
93c9037
commit cf396e7
Showing
4 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM img.dev.storj.io/storjup/base:20240509-1 AS binaries | ||
|
||
FROM google/cloud-sdk:492.0.0-slim AS final | ||
RUN apt-get install -y google-cloud-cli-spanner-emulator | ||
|
||
ADD pkg/recipe/startspanner.sh /var/lib/storj/startspanner.sh | ||
COPY --from=binaries /var/lib/storj/go/bin /var/lib/storj/go/bin | ||
|
||
ENTRYPOINT ["/var/lib/storj/startspanner.sh"] | ||
ENV PATH=$PATH:/var/lib/storj/go/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: spanner | ||
description: spanner DB. | ||
add: | ||
- name: spanner | ||
image: img.dev.storj.io/storjup/spanner:492.0.0 | ||
port: | ||
- name: gRPC | ||
description: Spanner gRPC port | ||
target: 9010 | ||
- name: REST | ||
description: Spanner REST port | ||
target: 9020 | ||
environment: | ||
PROJECT_ID: test-project | ||
INSTANCE_NAME: test-instance | ||
SPANNER_EMULATOR_URL: http://localhost:9020/ | ||
modify: | ||
- match: | ||
name: satellite-api,satellite-core,satellite-admin | ||
config: | ||
SPANNER_EMULATOR_HOST: 'spanner:9010' | ||
STORJ_METAINFO_DATABASE_URL: "spanner://projects/test-project/instances/test-instance/databases/metainfo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
set -xem | ||
echo "Starting Spanner dev container" | ||
|
||
gcloud emulators spanner start --host-port=0.0.0.0:9010& | ||
gcloud config set disable_prompts true | ||
gcloud config configurations create emulator | ||
gcloud config set auth/disable_credentials true | ||
gcloud config set project "${PROJECT_ID}" | ||
gcloud config set api_endpoint_overrides/spanner "${SPANNER_EMULATOR_URL}" | ||
gcloud spanner instances create "${INSTANCE_NAME}" --config=emulator-config --description=Emulator --nodes=1 | ||
|
||
#TODO: find a more flexible way to create the databases | ||
gcloud spanner databases create master --instance="${INSTANCE_NAME}" | ||
gcloud spanner databases create metainfo --instance="${INSTANCE_NAME}" | ||
|
||
fg %1 |