brantburnett / couchbasefakeit Goto Github PK
View Code? Open in Web Editor NEWDocker scripts for a base Couchbase Server image for testing/development, with support for fakeit for data generation
License: Apache License 2.0
Docker scripts for a base Couchbase Server image for testing/development, with support for fakeit for data generation
License: Apache License 2.0
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.
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
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.
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.
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?
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.