Couchbase service #
Run Couchbase as a background test dependency using FluentCI's native workspace service manager. Typed PureScript Wasm component; requires FluentCI v0.17.4+.
fluentci run couchbase start --version community-7.6.2
fluentci run couchbase status
fluentci run couchbase logs --tail 50 --follow true
fluentci run couchbase restart
fluentci run couchbase stop
Default profile #
- Image:
couchbase:community-7.6.2; override the tag with--version, or supply--imageinstead. - Primary port:
8091; exposed ports:8091, 11210. - Readiness: http
/pools; deadline180000ms.
Start exposes the management API. Call initialize, then create-bucket to prepare KV tests, and configure-network to advertise the actual published ports to host SDK clients. Defaults use a single-node KV cluster and disposable credentials.
Initialize a test cluster #
fluentci run couchbase initialize --services kv --memory-quota-mb 256
fluentci run couchbase create-bucket --bucket fluentci_test --ram-quota-mb 128
fluentci run couchbase configure-network
Start waits for the management API. Initialize and create-bucket preserve existing clusters and buckets; they never reset test data. configure-network advertises the actual published management/KV bindings at 127.0.0.1 for host SDK clients; run it again after restart because dynamic bindings may change. Configure clients for the external network and use the returned KV port. Override username/password together on initialization and later calls. Additional services require exposing their ports through --ports and setting appropriate server configuration.
Initialize a test cluster #
fluentci run couchbase initialize --services kv --memory-quota-mb 256
fluentci run couchbase create-bucket --bucket fluentci_test --ram-quota-mb 128
fluentci run couchbase configure-network
Start waits for the management API. Initialize and create-bucket preserve existing clusters and buckets; they never reset test data. configure-network advertises the actual published management/KV bindings at 127.0.0.1 for host SDK clients; run it again after restart because dynamic bindings may change. Configure clients for the external network and use the returned KV port. Override username/password together on initialization and later calls. Additional services require exposing their ports through --ports and setting appropriate server configuration.
Test configuration #
No environment overrides are required by default.
These are disposable CI defaults. Supply application-specific configuration with
--env 'KEY=value,OTHER=value'; credentials in service definitions are not a secret store.
Use --ports 'HOST:CONTAINER,CONTAINER', --volumes 'test-data:/data,/host/config:/config:ro',
and --command 'program,arg1,arg2' for native overrides. Lists are comma-separated,
trimmed, validated, and passed as literal tokens. CSV quotes preserve embedded commas.
No shell expansion or JSON object arguments are used.
Start is idempotent, waits for native readiness, and returns the actual loopback
endpoint plus every container/host port binding. Dynamic host ports may differ
from container ports: use returned bindings when constructing client URLs.
--project selects the same workspace for all lifecycle calls. Native recurring
health checks use the readiness probe unless --health-check false is supplied.
--startup-timeout-ms, --stop-timeout-ms, --restart-policy, --max-restarts,
--depends-on, --readiness-path, and --readiness-command customize lifecycle
behavior; see COMPONENT.md for the complete typed contract.
Interrupting followed logs leaves the service running. Stop targets this named service and its native dependents, removes its supervised container, and preserves explicitly mounted data. Always stop services in your pipeline's cleanup step. Docker must be available, locally or through the caller's Docker context.
Upstream configuration · Shared service behavior
Compose this module from code #
Requires FluentCI 0.17.6 or newer for generated pipeline bindings. From your caller module's directory, add the dependency:
fluentci add couchbase --path /path/to/fluentci-modules/services/couchbase
For a published module, use fluentci add @fluentci.io/couchbase@VERSION with an
available version. Commit the caller's manifest and lockfile. FluentCI generates
named bindings from the installed component's WIT; no handwritten FFI or CLI
subprocess is needed. Include generated source directories in the caller's SDK
project. The callee can use a different SDK from the caller.
Start couchbase for integration tests using couchbase:community-7.6.2. Return the allocated endpoint to the caller; use it when configuring your test client.
Replace the sample organization, paths and identifiers with your own. Configure credentials through your CI secret provider before running authenticated operations. Optional arguments use the callee's defaults, and public list fields use comma-separated strings. See COMPONENT.md for argument descriptions and return types.
These examples use the generated composition API and builder chaining in FluentCI 0.17.6; full cross-SDK compilation and execution coverage is still pending. See composition support and limitations.
For services, register stop with the same project/name in failure-safe cleanup before running tests. A later ordinary stop step will be skipped when a preceding step fails. This short example starts the service using its default scoped name; it is not a complete service lifecycle. Elixir Flow does not yet offer failure-safe cleanup.
PureScript #
module Main where
import Prelude
import Effect (Effect)
import FluentCI.Flow as Flow
import FluentCI.Modules.Couchbase as Couchbase
run :: Effect String
run =
Flow.pipeline "couchbase-start"
# Flow.workdir "."
# Couchbase.start (Couchbase.startArgs)
# Flow.map (\result -> result.endpoint)
# Flow.run
Gleam #
import fluentci/flow
import fluentci_modules/couchbase
pub fn run() -> String {
flow.pipeline("couchbase-start")
|> flow.workdir(".")
|> couchbase.start(couchbase.start_args())
|> flow.map(fn(result) { result.endpoint })
|> flow.run
}
Use Gleam's JavaScript target for the Wasm guest. BEAM escripts used for repository automation are separate from component guests.
Elixir #
defmodule Main do
use FluentCI.Plugin
alias FluentCI.Flow
alias FluentCI.Modules.Couchbase
defplugin run do
Flow.pipeline("couchbase-start")
|> Flow.workdir(".")
|> Couchbase.start(%{})
|> Flow.stdout()
end
end
Elixir compiles this sequence to Rust/Wasm. Its initial Flow API does not yet provide the typed result callbacks or cleanup combinators of the other examples.
ClojureScript #
(ns main.plugin
(:require [fluentci.flow :as flow]
[fluentci-modules.couchbase :as couchbase]))
(defn run []
(-> (flow/pipeline "couchbase-start")
(flow/workdir ".")
(couchbase/start {})
flow/run!))
ReScript #
let run = (): string =>
Flow.pipeline("couchbase-start")
->Flow.workdir(".")
->FluentciModulesCouchbase.start(FluentciModulesCouchbase.startArgs)
->Flow.map(result => result.endpoint)
->Flow.run
Python #
from fluentci.flow import pipeline
from fluentci_modules import couchbase
def run() -> str:
return (
pipeline("couchbase-start")
.workdir(".")
.pipe(couchbase.start, {})
.map(lambda result: result.endpoint)
.run()
)
TypeScript #
import * as flow from "./fluentci_modules/flow";
import * as couchbase from "./fluentci_modules/couchbase/index";
export function run(): string {
return flow.pipeline("couchbase-start")
.workdir(".")
.pipe(couchbase.start, {})
.map(result => result.endpoint)
.run();
}
Python and TypeScript use FluentCI builder chains: .pipe(module.function, args)
composes generated module functions with .workdir, .env, and .exec.
Functions return a pipeline carrying their typed result. Use a generated result
callback (With/_with, or a callback argument in TypeScript/Python) when a later
module needs a preceding result; use Flow's map operation to select a result field.
Execution begins at run (or the Elixir plugin terminal), in declared order.
Exported functions #
| Function | Purpose |
|---|---|
start |
Start an idempotent background service through FluentCI’s native workspace service manager and wait for readiness. |
stop |
Stop only this named service through the native manager; preserve explicitly mounted data. Native dependents are stopped too. |
restart |
Restart the existing native service definition and wait for readiness. |
status |
Return the service’s native lifecycle state and actual loopback port bindings. |
logs |
Read native service logs; optionally follow new output until interrupted, without starting or stopping a service. |
initialize |
Initialize a single-node Couchbase cluster idempotently; reuse an existing cluster only after authenticating its administrator. |
create_bucket |
Create a Couchbase test bucket if it is absent, preserving existing bucket data. |
configure_network |
Advertise the actual published loopback bindings to host Couchbase SDK clients. Call after initialize and again after a restart that changes ports. |