diff --git a/.circleci/ansible/deploy.yaml b/.circleci/ansible/deploy.yaml index 508843812a..a8154ba3b0 100644 --- a/.circleci/ansible/deploy.yaml +++ b/.circleci/ansible/deploy.yaml @@ -1,14 +1,14 @@ -- name: Upload Zenith binaries +- name: Upload Neon binaries hosts: storage gather_facts: False remote_user: admin tasks: - - name: get latest version of Zenith binaries + - name: get latest version of Neon binaries register: current_version_file set_fact: - current_version: "{{ lookup('file', '.zenith_current_version') | trim }}" + current_version: "{{ lookup('file', '.neon_current_version') | trim }}" tags: - pageserver - safekeeper @@ -19,11 +19,11 @@ - pageserver - safekeeper - - name: upload and extract Zenith binaries to /usr/local + - name: upload and extract Neon binaries to /usr/local ansible.builtin.unarchive: owner: root group: root - src: zenith_install.tar.gz + src: neon_install.tar.gz dest: /usr/local become: true tags: diff --git a/.circleci/ansible/get_binaries.sh b/.circleci/ansible/get_binaries.sh index 242a9e87e2..a4b4372d9f 100755 --- a/.circleci/ansible/get_binaries.sh +++ b/.circleci/ansible/get_binaries.sh @@ -4,10 +4,10 @@ set -e RELEASE=${RELEASE:-false} -# look at docker hub for latest tag fo zenith docker image +# look at docker hub for latest tag for neon docker image if [ "${RELEASE}" = "true" ]; then echo "search latest relase tag" - VERSION=$(curl -s https://registry.hub.docker.com/v1/repositories/zenithdb/zenith/tags |jq -r -S '.[].name' | grep release | sed 's/release-//g' | tail -1) + VERSION=$(curl -s https://registry.hub.docker.com/v1/repositories/neondatabase/neon/tags |jq -r -S '.[].name' | grep release | sed 's/release-//g' | tail -1) if [ -z "${VERSION}" ]; then echo "no any docker tags found, exiting..." exit 1 @@ -16,7 +16,7 @@ if [ "${RELEASE}" = "true" ]; then fi else echo "search latest dev tag" - VERSION=$(curl -s https://registry.hub.docker.com/v1/repositories/zenithdb/zenith/tags |jq -r -S '.[].name' | grep -v release | tail -1) + VERSION=$(curl -s https://registry.hub.docker.com/v1/repositories/neondatabase/neon/tags |jq -r -S '.[].name' | grep -v release | tail -1) if [ -z "${VERSION}" ]; then echo "no any docker tags found, exiting..." exit 1 @@ -28,25 +28,25 @@ fi echo "found ${VERSION}" # do initial cleanup -rm -rf zenith_install postgres_install.tar.gz zenith_install.tar.gz .zenith_current_version -mkdir zenith_install +rm -rf neon_install postgres_install.tar.gz neon_install.tar.gz .neon_current_version +mkdir neon_install # retrive binaries from docker image echo "getting binaries from docker image" -docker pull --quiet zenithdb/zenith:${TAG} -ID=$(docker create zenithdb/zenith:${TAG}) +docker pull --quiet neondatabase/neon:${TAG} +ID=$(docker create neondatabase/neon:${TAG}) docker cp ${ID}:/data/postgres_install.tar.gz . -tar -xzf postgres_install.tar.gz -C zenith_install -docker cp ${ID}:/usr/local/bin/pageserver zenith_install/bin/ -docker cp ${ID}:/usr/local/bin/safekeeper zenith_install/bin/ -docker cp ${ID}:/usr/local/bin/proxy zenith_install/bin/ -docker cp ${ID}:/usr/local/bin/postgres zenith_install/bin/ +tar -xzf postgres_install.tar.gz -C neon_install +docker cp ${ID}:/usr/local/bin/pageserver neon_install/bin/ +docker cp ${ID}:/usr/local/bin/safekeeper neon_install/bin/ +docker cp ${ID}:/usr/local/bin/proxy neon_install/bin/ +docker cp ${ID}:/usr/local/bin/postgres neon_install/bin/ docker rm -vf ${ID} # store version to file (for ansible playbooks) and create binaries tarball -echo ${VERSION} > zenith_install/.zenith_current_version -echo ${VERSION} > .zenith_current_version -tar -czf zenith_install.tar.gz -C zenith_install . +echo ${VERSION} > neon_install/.neon_current_version +echo ${VERSION} > .neon_current_version +tar -czf neon_install.tar.gz -C neon_install . # do final cleaup -rm -rf zenith_install postgres_install.tar.gz +rm -rf neon_install postgres_install.tar.gz diff --git a/.circleci/config.yml b/.circleci/config.yml index 643c853854..471d64a82f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,18 +1,18 @@ version: 2.1 executors: - zenith-xlarge-executor: + neon-xlarge-executor: resource_class: xlarge docker: # NB: when changed, do not forget to update rust image tag in all Dockerfiles - image: zimg/rust:1.58 - zenith-executor: + neon-executor: docker: - image: zimg/rust:1.58 jobs: check-codestyle-rust: - executor: zenith-xlarge-executor + executor: neon-xlarge-executor steps: - checkout - run: @@ -22,7 +22,7 @@ jobs: # A job to build postgres build-postgres: - executor: zenith-xlarge-executor + executor: neon-xlarge-executor parameters: build_type: type: enum @@ -67,9 +67,9 @@ jobs: paths: - tmp_install - # A job to build zenith rust code - build-zenith: - executor: zenith-xlarge-executor + # A job to build Neon rust code + build-neon: + executor: neon-xlarge-executor parameters: build_type: type: enum @@ -223,7 +223,7 @@ jobs: - "*" check-codestyle-python: - executor: zenith-executor + executor: neon-executor steps: - checkout - restore_cache: @@ -246,7 +246,7 @@ jobs: command: poetry run mypy . run-pytest: - executor: zenith-executor + executor: neon-executor parameters: # pytest args to specify the tests to run. # @@ -390,7 +390,7 @@ jobs: - "*" coverage-report: - executor: zenith-xlarge-executor + executor: neon-xlarge-executor steps: - attach_workspace: at: /tmp/zenith @@ -420,7 +420,7 @@ jobs: COMMIT_URL=https://github.com/neondatabase/neon/commit/$CIRCLE_SHA1 scripts/git-upload \ - --repo=https://$VIP_VAP_ACCESS_TOKEN@github.com/zenithdb/zenith-coverage-data.git \ + --repo=https://$VIP_VAP_ACCESS_TOKEN@github.com/neondatabase/zenith-coverage-data.git \ --message="Add code coverage for $COMMIT_URL" \ copy /tmp/zenith/coverage/report $CIRCLE_SHA1 # COPY FROM TO_RELATIVE @@ -437,7 +437,7 @@ jobs: \"target_url\": \"$REPORT_URL\" }" - # Build zenithdb/zenith:latest image and push it to Docker hub + # Build neondatabase/neon:latest image and push it to Docker hub docker-image: docker: - image: cimg/base:2021.04 @@ -451,18 +451,18 @@ jobs: - run: name: Build and push Docker image command: | - echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin + echo $NEON_DOCKER_PWD | docker login -u $NEON_DOCKER_LOGIN --password-stdin DOCKER_TAG=$(git log --oneline|wc -l) docker build \ --pull \ --build-arg GIT_VERSION=${CIRCLE_SHA1} \ --build-arg AWS_ACCESS_KEY_ID="${CACHEPOT_AWS_ACCESS_KEY_ID}" \ --build-arg AWS_SECRET_ACCESS_KEY="${CACHEPOT_AWS_SECRET_ACCESS_KEY}" \ - --tag zenithdb/zenith:${DOCKER_TAG} --tag zenithdb/zenith:latest . - docker push zenithdb/zenith:${DOCKER_TAG} - docker push zenithdb/zenith:latest + --tag neondatabase/neon:${DOCKER_TAG} --tag neondatabase/neon:latest . + docker push neondatabase/neon:${DOCKER_TAG} + docker push neondatabase/neon:latest - # Build zenithdb/compute-node:latest image and push it to Docker hub + # Build neondatabase/compute-node:latest image and push it to Docker hub docker-image-compute: docker: - image: cimg/base:2021.04 @@ -470,31 +470,31 @@ jobs: - checkout - setup_remote_docker: docker_layer_caching: true - # Build zenithdb/compute-tools:latest image and push it to Docker hub + # Build neondatabase/compute-tools:latest image and push it to Docker hub # TODO: this should probably also use versioned tag, not just :latest. # XXX: but should it? We build and use it only locally now. - run: name: Build and push compute-tools Docker image command: | - echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin + echo $NEON_DOCKER_PWD | docker login -u $NEON_DOCKER_LOGIN --password-stdin docker build \ --build-arg AWS_ACCESS_KEY_ID="${CACHEPOT_AWS_ACCESS_KEY_ID}" \ --build-arg AWS_SECRET_ACCESS_KEY="${CACHEPOT_AWS_SECRET_ACCESS_KEY}" \ - --tag zenithdb/compute-tools:latest -f Dockerfile.compute-tools . - docker push zenithdb/compute-tools:latest + --tag neondatabase/compute-tools:latest -f Dockerfile.compute-tools . + docker push neondatabase/compute-tools:latest - run: name: Init postgres submodule command: git submodule update --init --depth 1 - run: name: Build and push compute-node Docker image command: | - echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin + echo $NEON_DOCKER_PWD | docker login -u $NEON_DOCKER_LOGIN --password-stdin DOCKER_TAG=$(git log --oneline|wc -l) - docker build --tag zenithdb/compute-node:${DOCKER_TAG} --tag zenithdb/compute-node:latest vendor/postgres - docker push zenithdb/compute-node:${DOCKER_TAG} - docker push zenithdb/compute-node:latest + docker build --tag neondatabase/compute-node:${DOCKER_TAG} --tag neondatabase/compute-node:latest vendor/postgres + docker push neondatabase/compute-node:${DOCKER_TAG} + docker push neondatabase/compute-node:latest - # Build production zenithdb/zenith:release image and push it to Docker hub + # Build production neondatabase/neon:release image and push it to Docker hub docker-image-release: docker: - image: cimg/base:2021.04 @@ -508,18 +508,18 @@ jobs: - run: name: Build and push Docker image command: | - echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin + echo $NEON_DOCKER_PWD | docker login -u $NEON_DOCKER_LOGIN --password-stdin DOCKER_TAG="release-$(git log --oneline|wc -l)" docker build \ --pull \ --build-arg GIT_VERSION=${CIRCLE_SHA1} \ --build-arg AWS_ACCESS_KEY_ID="${CACHEPOT_AWS_ACCESS_KEY_ID}" \ --build-arg AWS_SECRET_ACCESS_KEY="${CACHEPOT_AWS_SECRET_ACCESS_KEY}" \ - --tag zenithdb/zenith:${DOCKER_TAG} --tag zenithdb/zenith:release . - docker push zenithdb/zenith:${DOCKER_TAG} - docker push zenithdb/zenith:release + --tag neondatabase/neon:${DOCKER_TAG} --tag neondatabase/neon:release . + docker push neondatabase/neon:${DOCKER_TAG} + docker push neondatabase/neon:release - # Build production zenithdb/compute-node:release image and push it to Docker hub + # Build production neondatabase/compute-node:release image and push it to Docker hub docker-image-compute-release: docker: - image: cimg/base:2021.04 @@ -527,29 +527,29 @@ jobs: - checkout - setup_remote_docker: docker_layer_caching: true - # Build zenithdb/compute-tools:release image and push it to Docker hub + # Build neondatabase/compute-tools:release image and push it to Docker hub # TODO: this should probably also use versioned tag, not just :latest. # XXX: but should it? We build and use it only locally now. - run: name: Build and push compute-tools Docker image command: | - echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin + echo $NEON_DOCKER_PWD | docker login -u $NEON_DOCKER_LOGIN --password-stdin docker build \ --build-arg AWS_ACCESS_KEY_ID="${CACHEPOT_AWS_ACCESS_KEY_ID}" \ --build-arg AWS_SECRET_ACCESS_KEY="${CACHEPOT_AWS_SECRET_ACCESS_KEY}" \ - --tag zenithdb/compute-tools:release -f Dockerfile.compute-tools . - docker push zenithdb/compute-tools:release + --tag neondatabase/compute-tools:release -f Dockerfile.compute-tools . + docker push neondatabase/compute-tools:release - run: name: Init postgres submodule command: git submodule update --init --depth 1 - run: name: Build and push compute-node Docker image command: | - echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin + echo $NEON_DOCKER_PWD | docker login -u $NEON_DOCKER_LOGIN --password-stdin DOCKER_TAG="release-$(git log --oneline|wc -l)" - docker build --tag zenithdb/compute-node:${DOCKER_TAG} --tag zenithdb/compute-node:release vendor/postgres - docker push zenithdb/compute-node:${DOCKER_TAG} - docker push zenithdb/compute-node:release + docker build --tag neondatabase/compute-node:${DOCKER_TAG} --tag neondatabase/compute-node:release vendor/postgres + docker push neondatabase/compute-node:${DOCKER_TAG} + docker push neondatabase/compute-node:release deploy-staging: docker: @@ -575,7 +575,7 @@ jobs: rm -f ssh-key ssh-key-cert.pub ansible-playbook deploy.yaml -i staging.hosts - rm -f zenith_install.tar.gz .zenith_current_version + rm -f neon_install.tar.gz .neon_current_version deploy-staging-proxy: docker: @@ -625,7 +625,7 @@ jobs: rm -f ssh-key ssh-key-cert.pub ansible-playbook deploy.yaml -i production.hosts - rm -f zenith_install.tar.gz .zenith_current_version + rm -f neon_install.tar.gz .neon_current_version deploy-release-proxy: docker: @@ -704,8 +704,8 @@ workflows: matrix: parameters: build_type: ["debug", "release"] - - build-zenith: - name: build-zenith-<< matrix.build_type >> + - build-neon: + name: build-neon-<< matrix.build_type >> matrix: parameters: build_type: ["debug", "release"] @@ -720,7 +720,7 @@ workflows: test_selection: batch_pg_regress needs_postgres_source: true requires: - - build-zenith-<< matrix.build_type >> + - build-neon-<< matrix.build_type >> - run-pytest: name: other-tests-<< matrix.build_type >> matrix: @@ -728,7 +728,7 @@ workflows: build_type: ["debug", "release"] test_selection: batch_others requires: - - build-zenith-<< matrix.build_type >> + - build-neon-<< matrix.build_type >> - run-pytest: name: benchmarks context: PERF_TEST_RESULT_CONNSTR @@ -737,7 +737,7 @@ workflows: run_in_parallel: false save_perf_report: true requires: - - build-zenith-release + - build-neon-release - coverage-report: # Context passes credentials for gh api context: CI_ACCESS_TOKEN @@ -833,6 +833,6 @@ workflows: # XXX: Successful build doesn't mean everything is OK, but # the job to be triggered takes so much time to complete (~22 min) # that it's better not to wait for the commented-out steps - - build-zenith-release + - build-neon-release # - pg_regress-tests-release # - other-tests-release diff --git a/.circleci/helm-values/production.proxy.yaml b/.circleci/helm-values/production.proxy.yaml index 27aa169c79..f2148c1d2c 100644 --- a/.circleci/helm-values/production.proxy.yaml +++ b/.circleci/helm-values/production.proxy.yaml @@ -1,6 +1,9 @@ # Helm chart values for zenith-proxy. # This is a YAML-formatted file. +image: + repository: neondatabase/neon + settings: authEndpoint: "https://console.zenith.tech/authenticate_proxy_request/" uri: "https://console.zenith.tech/psql_session/" diff --git a/.circleci/helm-values/staging.proxy.yaml b/.circleci/helm-values/staging.proxy.yaml index bdce4d80da..f4d9855476 100644 --- a/.circleci/helm-values/staging.proxy.yaml +++ b/.circleci/helm-values/staging.proxy.yaml @@ -1,6 +1,9 @@ # Helm chart values for zenith-proxy. # This is a YAML-formatted file. +image: + repository: neondatabase/neon + settings: authEndpoint: "https://console.stage.zenith.tech/authenticate_proxy_request/" uri: "https://console.stage.zenith.tech/psql_session/" diff --git a/Dockerfile b/Dockerfile index ebc8731168..a7afd1f335 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,9 @@ COPY . . # Show build caching stats to check if it was used in the end. # Has to be the part of the same RUN since cachepot daemon is killed in the end of this RUN, loosing the compilation stats. -RUN mold -run cargo build --release && cachepot -s +RUN set -e \ + && sudo -E "PATH=$PATH" mold -run cargo build --release \ + && cachepot -s # Build final image # diff --git a/Dockerfile.compute-tools b/Dockerfile.compute-tools index 3fc8702f3f..bbe0f517ce 100644 --- a/Dockerfile.compute-tools +++ b/Dockerfile.compute-tools @@ -8,7 +8,9 @@ ARG AWS_SECRET_ACCESS_KEY COPY . . -RUN mold -run cargo build -p compute_tools --release && cachepot -s +RUN set -e \ + && sudo -E "PATH=$PATH" mold -run cargo build -p compute_tools --release \ + && cachepot -s # Final image that only has one binary FROM debian:buster-slim