GithubHelp home page GithubHelp logo

roryq / spanner-emulator Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 6.0 91 KB

Docker image that wraps the official Google Cloud Spanner Emulator image which creates an instance/database on startup

Dockerfile 7.54% Go 76.67% Shell 15.78%
cloud-spanner spanner

spanner-emulator's Introduction

Google Cloud Spanner Emulator

This repository wraps the official Google Cloud Spanner Emulator with a convenience function to create an spanner instance on startup.

Usage

Set the SPANNER_DATABASE_ID, SPANNER_INSTANCE_ID and SPANNER_PROJECT_ID environment variables when running the image. You can omit the database id if you just need an instance.

docker run --env SPANNER_DATABASE_ID=db \
  --env SPANNER_INSTANCE_ID=inst \
  --env SPANNER_PROJECT_ID=proj \
  -p 9010:9010 -p 9020:9020 \
  roryq/spanner-emulator:latest

Thanks to jacksonjesse/pubsub-emulator for the idea.

spanner-emulator's People

Contributors

dbut2 avatar dipjyotimetia avatar roryq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

spanner-emulator's Issues

1.5.0 release stuck in restart loop

The 1.5.0 release gets stuck in a restart loop on container initialization. The only log it outputs is "Attempting to create instance ".

Downgrading to 1.4.8 resolved the issue.

By the way, thanks for this wonderfully useful Docker image!

getting connection refused on emulator server

Running the following command

docker run --env SPANNER_DATABASE_ID=test-database --env SPANNER_INSTANCE_ID=test-instance --env SPANNER_PROJECT_ID=test-project roryq/spanner-emulator:latest

I get the following output:

2022/01/12 21:17:37 gateway.go:140: Cloud Spanner emulator running.
2022/01/12 21:17:37 gateway.go:141: REST server listening at 0.0.0.0:9020
2022/01/12 21:17:37 gateway.go:142: gRPC server listening at 0.0.0.0:9010
2022/01/12 21:17:37 instance created
2022/01/12 21:17:37 attempting to create database test-database
2022/01/12 21:17:37 database created

Everything seems fine but I can't reach any request to emulator server.

curl --request GET -L "localhost:9020/v1/projects/project-test/instances"
curl: (7) Failed to connect to localhost port 9020: Refused connection

Running my application tests the same problem happens. In this case, the reported error is the following:

UNAVAILABLE: The connection string 'cloudspanner://localhost:9010/projects/test-project/instances/test-instance/databases/test-database;usePlainText=true' contains host 'localhost:9010', but no running emulator or other server could be found at that address.
Please check the connection string and/or that the emulator is running.

Any tip of what is happening here?

Error with version 1.4.6

Hello
I am getting an error with the version 1.4.6. Am I missing something?

mandhara@X447T6RJFM ~ % docker run --env SPANNER_DATABASE_ID=db \
  --env SPANNER_INSTANCE_ID=inst \
  --env SPANNER_PROJECT_ID=proj \
  -p 9010:9010 -p 9020:9020 \
  hub.artifactory.gcp.anz/roryq/spanner-emulator:1.4.6
exec ./spanner-emulator: no such file or directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.