Coder Social home page Coder Social logo

brantburnett / couchbasefakeit Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 6.0 400 KB

Docker scripts for a base Couchbase Server image for testing/development, with support for fakeit for data generation

License: Apache License 2.0

Shell 36.99% JavaScript 36.50% Dockerfile 26.51%
couchbase docker docker-image fakeit ha hacktoberfest

couchbasefakeit's People

Contributors

brantburnett avatar clupo avatar dependabot[bot] avatar jgroh9 avatar mgroves avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

couchbasefakeit's Issues

Depend on couchbase-quickinit

The fakeit npm package is somewhat dated and not ARM64 compatible, so a new project that excludes fakeit was created, couchbase-quick-init.

For maintainability, we should make this project simply depend on those images, adding fakeit support on top of the baseline and dropping ARM64 compatibility.

missing Couchbase MacOS M1-M2 ARM64 images support

When I tried couchbasefakeit on a MacBook M2 gets the following message error:

[+] Running 3/0
 ✔ Network db_default                                                                                                                                       Created                                        0.0s 
 ✔ Container db-couchbase-1                                                                                                                                 Created                                        0.0s 
 ! couchbase The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested                                                0.0s 
Attaching to db-couchbase-1
db-couchbase-1  | CB_VERSION=7.0.3
db-couchbase-1  | Initializing Couchbase Server 7.0.3...
db-couchbase-1  | Starting Couchbase Server -- Web UI available at http://<ip>:8091
db-couchbase-1  | and logs available in /opt/couchbase/var/lib/couchbase/logs
db-couchbase-1  | runtime: failed to create new OS thread (have 
db-couchbase-1  | 2 already; errno=22)
db-couchbase-1  | fatal error: newosproc
db-couchbase-1  | 
db-couchbase-1  | runtime stack:
db-couchbase-1  | 
db-couchbase-1  | runtime.throw(
db-couchbase-1  | 0x4d8d66, 0x9)
db-couchbase-1  |       /home/couchbase/.cbdepscache/exploded/x86_64/go-1.8.5/go/src/runtime/panic.go:596 +0x95
db-couchbase-1  | runtime.newosproc(0xc42002e000, 0xc42003e000)
db-couchbase-1  |       /home/couchbase/.cbdepscache/exploded/x86_64/go-1.8.5/go/src/runtime/os_linux.go:163
db-couchbase-1  |  +0x18c
db-couchbase-1  | runtime.newm(0x4df870, 0x0)
db-couchbase-1  |       /home/couchbase/.cbdepscache/exploded/x86_64/go-1.8.5/go/src/runtime/proc.go:1628 +0x137
db-couchbase-1  | runtime.main.func1()
db-couchbase-1  |       /home/couchbase/.cbdepscache/exploded/x86_64/go-1.8.5/go/src/runtime/proc.go:126 +0x36
db-couchbase-1  | runtime.systemstack(0x552700)
db-couchbase-1  |       /home/couchbase/.cbdepscache/exploded/x86_64/go-1.8.5/go/src/runtime/asm_amd64.s:327 +0x79
db-couchbase-1  | runtime.mstart()
db-couchbase-1  |       /home/couchbase/.cbdepscache/exploded/x86_64/go-1.8.5/go/src/runtime/proc.go:1132
db-couchbase-1  | 
db-couchbase-1  | 
db-couchbase-1  | goroutine 1 [running
db-couchbase-1  | ]:
db-couchbase-1  | runtime.systemstack_switch()
db-couchbase-1  |       /home/couchbase/.cbdepscache/exploded/x86_64/go-1.8.5/go/src/runtime/asm_amd64.s:281 fp=0xc42002a788 sp=0xc42002a780
db-couchbase-1  | runtime.main()
db-couchbase-1  |       /home/couchbase/.cbdepscache/exploded/x86_64/go-1.8.5/go/src/runtime/proc.go:127 +0x6c fp=0xc42002a7e0 sp=0xc42002a788
db-couchbase-1  | runtime.goexit()
db-couchbase-1  |       /home/couchbase/.cbdepscache/exploded/x86_64/go-1.8.5/go/src/runtime/asm_amd64.s:2197 +0x1
db-couchbase-1  |  fp=0xc42002a7e8 sp=0xc42002a7e0

Couchbase 7 Beta

Do you have any plans to create an image for Couchbase 7 Beta? If not, would you be willing to accept a PR for a Couchbase 7 Beta image.

Scopes and Collections: Requested resource not found.

The cURL commands to create scopes and collections have either changed or were coded incorrectly.

https://github.com/brantburnett/couchbasefakeit/blob/main/scripts/create-collections.sh#L15

https://github.com/brantburnett/couchbasefakeit/blob/main/scripts/create-collections.sh#L22

Proposed:

bucketName=$1

if [ -e "/startup/$bucketName/collections.json" ]; then
  echo "Creating scopes and collections in $bucketName..."

  # Create the scopes and collections
  while read scopeName
  do
    echo "Scope: $scopeName"
    # Check to see if the scope name provided is the default scope. If not, create the scope
    if [ $scopeName != "_default" ]; then
      echo "Creating scope: $scopeName on bucket $bucketName..."
      curl -Ss -X POST -u "$CB_USERNAME:$CB_PASSWORD" http://localhost:8091/pools/default/buckets/$bucketName/scopes -d name=$scopeName && echo
    fi

    # Create the collections within the appropriate scope
    while read collectionName
    do
      echo "Creating collection: $collectionName on $scopeName..."
      curl -Ss -X POST -u "$CB_USERNAME:$CB_PASSWORD" http://localhost:8091/pools/default/buckets/$bucketName/scopes/$scopeName/collections -d name=$collectionName && echo
    done < <(cat /startup/$bucketName/collections.json | jq -r ".scopes.$scopeName | .collections | .[]")
  done < <(cat /startup/$bucketName/collections.json | jq -r '.scopes | keys[]')
fi

Also the script is not being called from configure-node.sh.

https://github.com/brantburnett/couchbasefakeit/blob/main/scripts/configure-node.sh#L17-L23

Proposed:

  while read bucketName
  do
    $scriptPath/create-collections.sh $bucketName
    $scriptPath/create-views.sh $bucketName
    $scriptPath/create-n1ql-indexes.sh $bucketName
    $scriptPath/create-fts-indexes.sh $bucketName
    $scriptPath/configure-analytics.sh $bucketName
  done < <(cat /startup/buckets.json | jq -r '.[].name')

Haven't tested on anything but latest community-edition 7.0.2.

Add a permissive license

Hello, @brantburnett .
Thank you for the nice Docker image and script.
My company is developing software including your scripts, and would like to publish it as OSS licensed under Apache 2.0 .
Could you please place a permissive license on this repository?

When using volume mounts, can't create FTS aliases

If the consumer is mounting a volume on /startup, the fts_alias_template.json will be missing from the /startup folder. This prevents creating FTS aliases. This file should be moved to a safe folder that will not be affected by mounting /startup.

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.