From 10b291d4dbbbe3b35a15b25b8cc5692fb43ca3e0 Mon Sep 17 00:00:00 2001 From: wsodsong Date: Fri, 3 May 2024 11:56:10 +0700 Subject: [PATCH] Add Aida CI tests --- aida/CI.jenkinsfile | 185 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 aida/CI.jenkinsfile diff --git a/aida/CI.jenkinsfile b/aida/CI.jenkinsfile new file mode 100644 index 00000000..00d9a36c --- /dev/null +++ b/aida/CI.jenkinsfile @@ -0,0 +1,185 @@ +// Aida CI test runs aida-sdb, aida-vm-sdb and aida-vm at various fork blocks + +pipeline { + agent { label 'db-small-nvme' } + + options { + timestamps () + timeout(time: 3, unit: 'DAYS') + disableConcurrentBuilds(abortPrevious: false) + } + + environment { + GOROOT = '/usr/lib/go-1.21/' + GOGC = '50' + GOMEMLIMIT = '120GiB' + + CARMEN = '--db-impl carmen --db-variant go-file --carmen-schema 3' + PRIMEBUFFER = '4096' + TMPDB = '/mnt/tmp-disk' + AIDADB = '/mnt/aida-db-central/aida-db' + BLOCKS = 'zero,opera,london,berlin,lastpatch' + INTERVAL = '1000000' + } + + stages { + stage('Build') { + steps { + script { + currentBuild.description = 'Building on ${env.NODE_NAME}' + } + + checkout scmGit( + branches: [[name: 'develop']], + userRemoteConfigs: [[url: 'https://github.com/Fantom-foundation/Aida.git']] + ) + sh 'git submodule deinit -f --all' + sh 'git submodule update --init --recursive' + sh 'make clean' + sh 'make all' + } + } + + stage('aida-vm-replay') { + steps { + sh 'rm -f *.cpuprofile *.memprofile *.log' + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE', message: 'Test Suite had a failure') { + script { + BLOCKS.tokenize(',').each { block ->; + sh """build/aida-vm --vm-impl lfvm \ + --aida-db ${AIDADB} \ + --workers 32 \ + --validate-tx \ + --cpu-profile=${BUILD_NUMBER}-${STAGE_NAME}-LFVM-${block}.cpuprofile \ + ${block} ${block}+${INTERVAL}""" + sh """build/aida-vm --vm-impl geth \ + --aida-db ${AIDADB} \ + --workers 32 \ + --validate-tx \ + --cpu-profile=${BUILD_NUMBER}-${STAGE_NAME}-GETHVM-${block}.cpuprofile \ + ${block} ${block}+${INTERVAL}""" + } + } + } + archiveArtifacts artifacts: '*.cpuprofile' + } + } + + stage('aida-fuzzing') { + steps { + sh 'rm -f *.cpuprofile *.memprofile *.log *.dat' + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE', message: 'Test Suite had a failure') { + sh """build/aida-stochastic-sdb replay ${CARMEN} \ + --db-tmp ${TMPDB} \ + --db-shadow-impl geth \ + 1000 data/simulation_uniform.json""" + } + } + } + + stage('aida-sdb-record') { + steps { + sh 'mkdir -p tracefiles' + sh 'rm -rf tracefiles/*' + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE', message: 'Test Suite had a failure') { + sh 'build/aida-sdb record --cpu-profile cpu-profile-0.dat --trace-file tracefiles/trace-0.dat --aida-db ${AIDADB} opera opera+100000' + sh 'build/aida-sdb record --cpu-profile cpu-profile-1.dat --trace-file tracefiles/trace-1.dat --aida-db ${AIDADB} opera+100001 opera+200000' + sh 'build/aida-sdb record --cpu-profile cpu-profile-2.dat --trace-file tracefiles/trace-2.dat --aida-db ${AIDADB} opera+200001 opera+300000' + } + } + } + + stage('aida-sdb-replay') { + steps { + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE', message: 'Test Suite had a failure') { + // one trace file + sh """build/aida-sdb replay ${CARMEN} \ + --vm-impl lfvm \ + --db-tmp ${TMPDB} \ + --aida-db ${AIDADB} \ + --update-buffer-size ${PRIMEBUFFER} \ + --shadow-db --db-shadow-impl geth \ + --cpu-profile cpu-profile.dat \ + --memory-profile mem-profile.dat \ + --memory-breakdown \ + --trace-file tracefiles/trace-0.dat opera opera+100000""" + // multiple trace files + sh """build/aida-sdb replay ${CARMEN} \ + --vm-impl lfvm \ + --db-tmp ${TMPDB} \ + --aida-db ${AIDADB} \ + --update-buffer-size ${PRIMEBUFFER} \ + --shadow-db --db-shadow-impl geth \ + --cpu-profile cpu-profile.dat \ + --memory-profile mem-profile.dat \ + --memory-breakdown \ + --trace-dir tracefiles opera opera+300000""" + } + sh 'rm -rf tracefiles' + } + } + + stage('aida-vm-sdb-carmen') { + steps { + sh 'rm -f *.cpuprofile *.memprofile *.log' + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE', message: 'Test Suite had a failure') { + script { + BLOCKS.tokenize(',').each { block ->; + sh """build/aida-vm-sdb substate ${CARMEN} \ + --vm-impl lfvm \ + --db-tmp ${TMPDB} \ + --aida-db ${AIDADB} \ + --update-buffer-size ${PRIMEBUFFER} \ + --validate-tx \ + --cpu-profile=${BUILD_NUMBER}-${STAGE_NAME}-${block}.cpuprofile \ + --memory-profile=${BUILD_NUMBER}-${STAGE_NAME}-${block}.memprofile \ + ${block} ${block}+${INTERVAL}""" + } + } + } + archiveArtifacts artifacts: '*.cpuprofile,*.memprofile,*.log' + } + } + + stage('aida-vm-sdb-archive') { + steps { + sh 'rm -f *.cpuprofile *.memprofile *.log' + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE', message: 'Test Suite had a failure') { + sh """build/aida-vm-sdb substate ${CARMEN} \ + --vm-impl lfvm \ + --db-tmp ${TMPDB} \ + --aida-db ${AIDADB} \ + --update-buffer-size ${PRIMEBUFFER} \ + --keep-db \ + --archive --archive-variant ldb \ + --cpu-profile=${BUILD_NUMBER}-${STAGE_NAME}.cpuprofile \ + --memory-profile=${BUILD_NUMBER}-${STAGE_NAME}.memprofile \ + 43000000 44000000""" + } + archiveArtifacts artifacts: '*.cpuprofile,*.memprofile,*.log' + } + } + + stage('aida-vm-adb') { + steps { + sh 'rm -f *.cpuprofile *.memprofile *.log' + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE', message: 'Test Suite had a failure') { + sh """build/aida-vm-adb --vm-impl lfvm \ + --aida-db ${AIDADB} \ + --workers 20 \ + --db-src ${TMPDB}/state_db_carmen_go-file_44000000 \ + --cpu-profile=${BUILD_NUMBER}-${STAGE_NAME}.cpuprofile \ + 43000000 44000000""" + } + sh 'rm -fr ${TMPDB}/state_db_carmen_go-file_44000000' + archiveArtifacts artifacts: '*.cpuprofile' + } + } + + stage('teardown') { + steps { + sh 'make clean' + } + } + } +}