Skip to content

Commit

Permalink
[rename] Ops related rename diem->aptos
Browse files Browse the repository at this point in the history
This is a largely untested change that just bulk changes everything. I expect we'll need to re-run all the services, identify breakage and post another commit
This includes:
docker
terraform
  • Loading branch information
davidiw committed Mar 7, 2022
1 parent 212bb55 commit 25b6ce3
Show file tree
Hide file tree
Showing 125 changed files with 1,129 additions and 1,129 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
command: ./docker/<< parameters.image-name >>/build.sh
no_output_timeout: 30m
- aws-setup
- run: SOURCE=diem/<< parameters.target-image-name >>:latest TARGET_REPO="${AWS_ECR_ACCOUNT_URL}/diem/<< parameters.target-image-name >>" TARGET_TAGS="${TAGS}:main_$(git rev-parse --short=8 HEAD),latest" docker/tag-and-push.sh
- run: SOURCE=aptos/<< parameters.target-image-name >>:latest TARGET_REPO="${AWS_ECR_ACCOUNT_URL}/aptos/<< parameters.target-image-name >>" TARGET_TAGS="${TAGS}:main_$(git rev-parse --short=8 HEAD),latest" docker/tag-and-push.sh
# a dummy job so that we can require auto or canary branches
require-bors:
machine:
Expand Down
8 changes: 4 additions & 4 deletions docker/aptos-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
set -e

DOCKERFILE=$1
if [ -z "$DIEM_BUILD_TAG" ]; then
if [ -z "$APTOS_BUILD_TAG" ]; then
TAGS="--tag $2"
else
TAGS="--tag $2 --tag $DIEM_BUILD_TAG"
TAGS="--tag $2 --tag $APTOS_BUILD_TAG"
fi

RESTORE='\001\033[0m\002'
Expand Down Expand Up @@ -50,7 +50,7 @@ if [ "$1" = "--incremental" ]; then
echo "${BLUE}Build container does not exist, setting up new one${RESTORE}"
IMAGE=circleci/rust:${TOOLCHAIN}-buster
mkdir -p "$OUT_TARGET"
docker run -u root -d -t -v "$OUT_TARGET:/out-target" -v "$DIR/..:/diem" -w /diem --name "$CONTAINER" "$IMAGE" sh > /dev/null
docker run -u root -d -t -v "$OUT_TARGET:/out-target" -v "$DIR/..:/aptos" -w /aptos --name "$CONTAINER" "$IMAGE" sh > /dev/null
docker exec -i -t "$CONTAINER" apt-get update
docker exec -i -t "$CONTAINER" apt-get install -y cmake curl clang git
echo "${BLUE}Container is set up, starting build${RESTORE}"
Expand All @@ -65,7 +65,7 @@ if [ "$1" = "--incremental" ]; then
docker exec -i -t "$CONTAINER" sh -c 'find /target/release -maxdepth 1 -executable -type f | xargs -I F cp F /out-target'
TMP_DOCKERFILE="$DOCKERFILE.tmp"
trap 'rm -f $TMP_DOCKERFILE' EXIT
sed -e "s+$DOCKERFILE_BUILD_RE+RUN mkdir -p /diem/target/release/; cp target-out-docker/* /diem/target/release/+g" \
sed -e "s+$DOCKERFILE_BUILD_RE+RUN mkdir -p /aptos/target/release/; cp target-out-docker/* /aptos/target/release/+g" \
"$DOCKERFILE" > "$TMP_DOCKERFILE"
DOCKERFILE=$TMP_DOCKERFILE
echo "${BLUE}Starting docker build process${RESTORE}"
Expand Down
2 changes: 1 addition & 1 deletion docker/build-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ fi

rm -rf target/release/{build,deps,incremental}

STRIP_DIR=${STRIP_DIR:-/diem/target}
STRIP_DIR=${STRIP_DIR:-/aptos/target}
find "$STRIP_DIR/release" -maxdepth 1 -executable -type f | grep -Ev 'aptos-node|safety-rules' | xargs strip
4 changes: 2 additions & 2 deletions docker/build-push-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ echo "[$(date)] Using tag $TAG"
for (( i=0; i < ${#BUILD_PROJECTS[@]}; i++ ));
do
PROJECT=${BUILD_PROJECTS[$i]}
export DIEM_BUILD_TAG="$REPO/diem_${PROJECT/-/_}:$TAG"
export APTOS_BUILD_TAG="$REPO/aptos_${PROJECT/-/_}:$TAG"
DOCKER_BUILDER="$PROJECT"
echo "[$(date)] Building $PROJECT via $DOCKER_BUILDER"
"./docker/${DOCKER_BUILDER}/build.sh" --incremental
echo "[$(date)] Pushing $PROJECT"
time docker push "$DIEM_BUILD_TAG"
time docker push "$APTOS_BUILD_TAG"
done

echo "[$(date)] Build complete"
6 changes: 3 additions & 3 deletions docker/build_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ function usage {
echo "-b the branch we're building on, or the branch we're targeting if a prebuild"
echo "-n name, one of init, faucet, validator, validator-tcb, forge"
echo "-u 'upload', or 'push' the docker images will be pushed to dockerhub, otherwise only locally tag"
echo "-o the org to target on dockerhub. Defaults to 'diem'"
echo "should be called from the root folder of the diem project, and must have it's .git history"
echo "-o the org to target on dockerhub. Defaults to 'aptos'"
echo "should be called from the root folder of the aptos project, and must have it's .git history"
}

PREBUILD=false;
INPUT_NAME=
BRANCH=
ORG=diem
ORG=aptos
PUSH=false

#parse args
Expand Down
10 changes: 5 additions & 5 deletions docker/ci/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# while using circle we'll use circle's base image.
FROM alpine:3.14.2@sha256:e1c082e3d3c45cccac829840a25941e679c25d438cc8412c2fa221cf1a824e6a AS setup_ci_alpine

WORKDIR /diem
COPY rust-toolchain /diem/rust-toolchain
COPY scripts/dev_setup.sh /diem/scripts/dev_setup.sh
WORKDIR /aptos
COPY rust-toolchain /aptos/rust-toolchain
COPY scripts/dev_setup.sh /aptos/scripts/dev_setup.sh

ENV HOME "/github/home"
#Needed for sccache to function, and to work around home dir being blatted.
Expand All @@ -14,7 +14,7 @@ RUN apk add bash=5.1.4-r0 --no-cache && \
mkdir -p /github/home && \
mkdir -p /opt/cargo/ && \
mkdir -p /opt/git/ && \
/diem/scripts/dev_setup.sh -t -o -b -p -y -s -n
/aptos/scripts/dev_setup.sh -t -o -b -p -y -s -n

ENV DOTNET_ROOT "/opt/dotnet"
ENV Z3_EXE "/opt/bin/z3"
Expand All @@ -40,7 +40,7 @@ RUN [ -x "$(set -x; command -v shellcheck)" ] \
&& [ -x "$(set -x; command -v aws)" ] \
&& [ -x "$(set -x; command -v z3)" ] \
&& [ -x "$(set -x; command -v "$BOOGIE_EXE")" ] \
&& [ -x "$(set -x; xargs rustup which cargo --toolchain < /diem/rust-toolchain )" ] \
&& [ -x "$(set -x; xargs rustup which cargo --toolchain < /aptos/rust-toolchain )" ] \
&& [ -x "$(set -x; command -v tidy)" ] \
&& [ -x "$(set -x; command -v xsltproc)" ] \
&& [ -x "$(set -x; command -v javac)" ] \
Expand Down
10 changes: 5 additions & 5 deletions docker/ci/arch/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# while using circle we'll use circle's base image.
FROM archlinux:base-devel-20211024.0.37588@sha256:4371fd5b5d2d99ee73e25b3b9a8d7b2258e371852dd0c5681802bf94b069aadf AS setup_ci_arch

WORKDIR /diem
COPY rust-toolchain /diem/rust-toolchain
COPY scripts/dev_setup.sh /diem/scripts/dev_setup.sh
WORKDIR /aptos
COPY rust-toolchain /aptos/rust-toolchain
COPY scripts/dev_setup.sh /aptos/scripts/dev_setup.sh

ENV HOME "/github/home"
#Needed for sccache to function, and to work around home dir being blatted.
Expand All @@ -21,7 +21,7 @@ RUN pacman -Sy archlinux-keyring --noconfirm && \
mkdir -p /github/home && \
mkdir -p /opt/cargo/ && \
mkdir -p /opt/git/ && \
/diem/scripts/dev_setup.sh -t -o -b -p -y -n && \
/aptos/scripts/dev_setup.sh -t -o -b -p -y -n && \
pacman -Scc --noconfirm

ENV DOTNET_ROOT "/opt/dotnet"
Expand Down Expand Up @@ -49,7 +49,7 @@ RUN [ -x "$(set -x; command -v shellcheck)" ] \
&& [ -x "$(set -x; command -v aws)" ] \
&& [ -x "$(set -x; command -v z3)" ] \
&& [ -x "$(set -x; command -v "$BOOGIE_EXE")" ] \
&& [ -x "$(set -x; xargs rustup which cargo --toolchain < /diem/rust-toolchain )" ] \
&& [ -x "$(set -x; xargs rustup which cargo --toolchain < /aptos/rust-toolchain )" ] \
&& [ -x "$(set -x; command -v tidy)" ] \
&& [ -x "$(set -x; command -v xsltproc)" ]
# These should eventually be installed and tested, but since we don't automate on arch, low pri.
Expand Down
12 changes: 6 additions & 6 deletions docker/ci/github/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM debian:buster-20211011@sha256:f9182ead292f45165f4a851e5ff98ea0800e172ccedce7d17764ffaae5ed4d6e AS setup_ci

RUN mkdir /diem
COPY rust-toolchain /diem/rust-toolchain
COPY scripts/dev_setup.sh /diem/scripts/dev_setup.sh
RUN mkdir /aptos
COPY rust-toolchain /aptos/rust-toolchain
COPY scripts/dev_setup.sh /aptos/scripts/dev_setup.sh

#this is the default home on docker images in gha, until it's not?
ENV HOME "/github/home"
Expand All @@ -14,7 +14,7 @@ ENV RUSTUP_HOME "/opt/rustup"
RUN mkdir -p /github/home && \
mkdir -p /opt/cargo/ && \
mkdir -p /opt/git/ && \
/diem/scripts/dev_setup.sh -t -o -b -p -y -s -n -a && \
/aptos/scripts/dev_setup.sh -t -o -b -p -y -s -n -a && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -42,7 +42,7 @@ RUN [ -x "$(set -x; command -v shellcheck)" ] \
&& [ -x "$(set -x; command -v aws)" ] \
&& [ -x "$(set -x; command -v z3)" ] \
&& [ -x "$(set -x; command -v "$BOOGIE_EXE")" ] \
&& [ -x "$(set -x; xargs rustup which cargo --toolchain < /diem/rust-toolchain )" ] \
&& [ -x "$(set -x; xargs rustup which cargo --toolchain < /aptos/rust-toolchain )" ] \
&& [ -x "$(set -x; command -v tidy)" ] \
&& [ -x "$(set -x; command -v xsltproc)" ] \
&& [ -x "$(set -x; command -v javac)" ] \
Expand All @@ -54,6 +54,6 @@ RUN [ -x "$(set -x; command -v shellcheck)" ] \

# should be a no-op
# sccache builds fine, but is not executable ??? in alpine, ends up being recompiled. Wierd.
RUN /diem/scripts/dev_setup.sh -t -o -y -b -p -s -a
RUN /aptos/scripts/dev_setup.sh -t -o -y -b -p -s -a

FROM setup_ci as build_environment
10 changes: 5 additions & 5 deletions docker/compose/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
id: docker_compose
title: Diem Docker-Compose Configuration
custom_edit_url: https://github.com/diem/diem/edit/main/docker/compose/README.md
title: Aptos Docker-Compose Configuration
custom_edit_url: https://github.com/aptos/aptos/edit/main/docker/compose/README.md
---

This directory contains the following compose configurations:
* **validator-testnet**: creates a single validator test network, and a faucet that directly connects to it
* **public_full_node**: creates a public fullnode, and it can be configured to connect to any existing network (e.g. testnet, Mainnet).
* **monitoring**: creates a monitoring stack which can be used to collect metrics and virtulize it on a dashboard. This can be installed together with other compose configurations and provides simple monitoring for the deployment.
* **data-restore**: creates a diem db-restore job to restore a data volume from provided S3 bucket. This can be used to quickly restore fullnode for an exsiting blockchain to avoid spending long time on state-sync.
* **data-restore**: creates a aptos db-restore job to restore a data volume from provided S3 bucket. This can be used to quickly restore fullnode for an exsiting blockchain to avoid spending long time on state-sync.

To use these compositions:
1. [Download](https://docs.docker.com/install/) and install Docker and Docker Compose (comes with Docker for Mac and Windows).
Expand All @@ -25,6 +25,6 @@ To build your own complete testnet:
2. JSON-RPC will be available at http://127.0.0.1:8080

If you would like to clear the validator/blockchain data and start from scratch, either remove the docker volume `aptos-shared`,
or run `docker-compose run validator rm -rf '/opt/diem/var/*'` from the **validator-testnet** directory.
or run `docker-compose run validator rm -rf '/opt/aptos/var/*'` from the **validator-testnet** directory.

To clear just the validator logs, run `docker-compose run validator rm -rf '/opt/diem/var/validator.log'`
To clear just the validator logs, run `docker-compose run validator rm -rf '/opt/aptos/var/validator.log'`
12 changes: 6 additions & 6 deletions docker/compose/data-restore/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
version: "3.8"
services:
restore:
image: diem/tools:devnet
image: aptos/tools:devnet
volumes:
- type: volume
source: db
target: /opt/diem/data
target: /opt/aptos/data
- type: volume
source: tmp
target: /tmp
- type: bind
source: ./s3-public.toml
target: /opt/diem/etc/s3-public.toml
target: /opt/aptos/etc/s3-public.toml
read_only: true
# Provide the public S3 bucket and the sub directory you want to restore data from.
# Diem Association provides public data backup you can use, check the offical website.
# Aptos Association provides public data backup you can use, check the offical website.
environment:
- BUCKET=<S3 bucket>
- SUB_DIR=<sub directory of the S3 bucket>
Expand All @@ -25,9 +25,9 @@ services:
command: >
sh -c "
/usr/local/bin/db-restore --concurrent-downloads 2 \
--target-db-dir /opt/diem/data/db auto \
--target-db-dir /opt/aptos/data/db auto \
--metadata-cache-dir /tmp/aptos-restore-metadata \
command-adapter --config /opt/diem/etc/s3-public.toml
command-adapter --config /opt/aptos/etc/s3-public.toml
"
# update the db volume name to the one you want to restore if needed
Expand Down
26 changes: 13 additions & 13 deletions docker/compose/monitoring/grafana/dashboards/fullnode.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"targets": [
{
"exemplar": true,
"expr": "(diem_state_sync_timestamp{type=\"real\"} - on (instance, job) diem_state_sync_timestamp{type=\"synced\"})",
"expr": "(aptos_state_sync_timestamp{type=\"real\"} - on (instance, job) aptos_state_sync_timestamp{type=\"synced\"})",
"interval": "",
"legendFormat": "",
"refId": "A"
Expand Down Expand Up @@ -186,14 +186,14 @@
"targets": [
{
"exemplar": true,
"expr": "diem_state_sync_version{type=\"committed\"}",
"expr": "aptos_state_sync_version{type=\"committed\"}",
"interval": "",
"legendFormat": "committed",
"refId": "A"
},
{
"exemplar": true,
"expr": "diem_state_sync_version{type=\"synced\"}",
"expr": "aptos_state_sync_version{type=\"synced\"}",
"hide": false,
"interval": "",
"legendFormat": "synced",
Expand Down Expand Up @@ -291,7 +291,7 @@
"targets": [
{
"exemplar": true,
"expr": "rate(diem_state_sync_version{type=\"synced\"}[5m])",
"expr": "rate(aptos_state_sync_version{type=\"synced\"}[5m])",
"interval": "",
"legendFormat": "",
"refId": "A"
Expand Down Expand Up @@ -386,7 +386,7 @@
"targets": [
{
"exemplar": true,
"expr": "(diem_state_sync_version{type=\"highest\"} - on(instance, job) diem_state_sync_version{type=\"committed\"}) < bool 15",
"expr": "(aptos_state_sync_version{type=\"highest\"} - on(instance, job) aptos_state_sync_version{type=\"committed\"}) < bool 15",
"interval": "",
"legendFormat": "",
"refId": "A"
Expand Down Expand Up @@ -481,7 +481,7 @@
"targets": [
{
"exemplar": true,
"expr": "diem_state_sync_epoch",
"expr": "aptos_state_sync_epoch",
"interval": "",
"legendFormat": "epoch",
"refId": "A"
Expand Down Expand Up @@ -578,7 +578,7 @@
"targets": [
{
"exemplar": true,
"expr": "sum(diem_state_sync_active_upstream_peers) by (instance, job) ",
"expr": "sum(aptos_state_sync_active_upstream_peers) by (instance, job) ",
"interval": "",
"legendFormat": "",
"refId": "A"
Expand Down Expand Up @@ -687,7 +687,7 @@
"targets": [
{
"exemplar": true,
"expr": "diem_core_mempool_index_size{index=\"system_ttl\"}",
"expr": "aptos_core_mempool_index_size{index=\"system_ttl\"}",
"interval": "",
"legendFormat": "",
"refId": "A"
Expand Down Expand Up @@ -782,7 +782,7 @@
"targets": [
{
"exemplar": true,
"expr": "diem_core_mempool_txn_commit_latency_sum / diem_core_mempool_txn_commit_latency_count",
"expr": "aptos_core_mempool_txn_commit_latency_sum / aptos_core_mempool_txn_commit_latency_count",
"interval": "",
"legendFormat": "",
"refId": "A"
Expand Down Expand Up @@ -849,7 +849,7 @@
"dashLength": 10,
"dashes": false,
"datasource": null,
"description": "Number of Inbound Connections as measured by DiemNet",
"description": "Number of Inbound Connections as measured by AptosNet",
"fieldConfig": {
"defaults": {},
"overrides": []
Expand Down Expand Up @@ -891,7 +891,7 @@
"targets": [
{
"exemplar": true,
"expr": "diem_connections{direction=\"inbound\",network_id=\"Public\"}",
"expr": "aptos_connections{direction=\"inbound\",network_id=\"Public\"}",
"interval": "",
"legendFormat": "{{peer_id}}",
"refId": "A"
Expand Down Expand Up @@ -944,7 +944,7 @@
"dashLength": 10,
"dashes": false,
"datasource": null,
"description": "Number of Outbound Network Connections as measured by DiemNet",
"description": "Number of Outbound Network Connections as measured by AptosNet",
"fieldConfig": {
"defaults": {},
"overrides": []
Expand Down Expand Up @@ -986,7 +986,7 @@
"targets": [
{
"exemplar": true,
"expr": "diem_connections{direction=\"outbound\",network_id=\"Public\"}",
"expr": "aptos_connections{direction=\"outbound\",network_id=\"Public\"}",
"interval": "",
"legendFormat": "{{peer_id}}",
"refId": "A"
Expand Down
Loading

0 comments on commit 25b6ce3

Please sign in to comment.