Configure FoundationDB service container's database via Docker, removing `fdbcli` dependency
This commit is contained in:
parent
fa1cd5c263
commit
12b4ceb4aa
|
@ -17,6 +17,7 @@ jobs:
|
||||||
# Note: this should generally match the version of the FoundationDB SERVER deployed in production; it's okay if
|
# Note: this should generally match the version of the FoundationDB SERVER deployed in production; it's okay if
|
||||||
# it's a little behind the CLIENT version.
|
# it's a little behind the CLIENT version.
|
||||||
image: foundationdb/foundationdb:7.3.62
|
image: foundationdb/foundationdb:7.3.62
|
||||||
|
options: --name foundationdb
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
@ -32,8 +33,25 @@ jobs:
|
||||||
HOME: /root
|
HOME: /root
|
||||||
- name: Install APT packages
|
- name: Install APT packages
|
||||||
# ca-certificates: required for AWS CRT client
|
# ca-certificates: required for AWS CRT client
|
||||||
run: apt update && apt install -y ca-certificates
|
run: |
|
||||||
- name: Download and install FoundationDB client library
|
# Add Docker's official GPG key:
|
||||||
|
apt update
|
||||||
|
apt install -y ca-certificates curl
|
||||||
|
install -m 0755 -d /etc/apt/keyrings
|
||||||
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
|
||||||
|
chmod a+r /etc/apt/keyrings/docker.asc
|
||||||
|
|
||||||
|
# Add Docker repository to apt sources:
|
||||||
|
echo \
|
||||||
|
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
|
||||||
|
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
|
||||||
|
tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
|
||||||
|
# ca-certificates: required for AWS CRT client
|
||||||
|
apt update && apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin ca-certificates
|
||||||
|
- name: Configure FoundationDB database
|
||||||
|
run: docker exec foundationdb /usr/bin/fdbcli --exec 'configure new single memory'
|
||||||
|
- name: Download and install FoundationDB client
|
||||||
run: |
|
run: |
|
||||||
./mvnw -e -B -Pexclude-spam-filter clean prepare-package -DskipTests=true
|
./mvnw -e -B -Pexclude-spam-filter clean prepare-package -DskipTests=true
|
||||||
cp service/target/jib-extra/usr/lib/libfdb_c.x86_64.so /usr/lib/libfdb_c.x86_64.so
|
cp service/target/jib-extra/usr/lib/libfdb_c.x86_64.so /usr/lib/libfdb_c.x86_64.so
|
||||||
|
|
|
@ -38,16 +38,6 @@ class ServiceContainerFoundationDbDatabaseLifecycleManager implements Foundation
|
||||||
fileWriter.write(String.format("docker:docker@%s:4500", foundationDbServiceContainerName));
|
fileWriter.write(String.format("docker:docker@%s:4500", foundationDbServiceContainerName));
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we don't initialize the database before trying to use it, things will just hang in a mysterious, message-free
|
|
||||||
// way. Note that the `new` keyword in `configure new single memory` means that we can't accidentally clobber an
|
|
||||||
// existing database (though initialization may fail if there's already a database present).
|
|
||||||
new ProcessBuilder("/usr/bin/fdbcli",
|
|
||||||
"-C", clusterFile.getAbsolutePath(),
|
|
||||||
"--exec", "configure new single memory")
|
|
||||||
.start()
|
|
||||||
.onExit()
|
|
||||||
.join();
|
|
||||||
|
|
||||||
database = fdb.open(clusterFile.getAbsolutePath());
|
database = fdb.open(clusterFile.getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue