Creating our own / custom foundation db builds

Hello,

I have a need to build an fdb binary with azure-backup support turned on and I am following instructions in two different repos. I am looking for a confirmation if I am on the right path.

The repo FoundationDB/fdb-build-support has instructions to build, but I am finding that some of the dockerfiles mentioned, such as foundationdb/codebuild doesn’t exist in the public Dockerhub.

Instead I do find some instructions in the apple/foundationdb main repo to build a .deb package.

I am following a combination of instructions from both repos. Let me know if I am going down the wrong path or looking at obsolete instructions.

I appreciate your help.

Thanks


Hari

Here is a complete working GitLab CI .gitlab-ci.yml example for building DEB packages that worked for me. You can take a look at image and sequence of commands if you use another build facility.

stages:
  - build
  - test
  - deploy

build-job:
  stage: build
  image: foundationdb/build:centos7-latest
  script:
    - git clone --depth 1 --branch 7.1.15 https://github.com/apple/foundationdb.git
    - mkdir build
    - cd build
    - source /opt/rh/devtoolset-8/enable && source /opt/rh/rh-python38/enable && cmake -DFDB_RELEASE=ON -G Ninja ../foundationdb
    - ninja -j2
    - cpack -G DEB
    - ls -laR packages
    - rm -rf packages/bin
    - rm -rf packages/*versioned*
    - rm -rf packages/*.tar.gz
    - rm -rf packages/*ddeb*
  artifacts:
    name: target
    when: always
    expire_in: 1 days
    paths:
      - build/packages

1 Like

What @Imperatorx did should work. Essentially, the build uses foundationdb/build:centos7-latest docker image, which is based on fdb-build-support/Dockerfile at main · FoundationDB/fdb-build-support · GitHub.

Then inside this docker, assuming the foundationdb source repo is at ${HOME}/src/foundationdb, then you can run either cmk (using gcc) or ccmk (using clang) to compile everything. The output will be inside ${HOME}/build_output directory.