Skip to content

Commit

Permalink
Merge branch 'main' into js_registry_public_header
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyashton authored Jun 3, 2024
2 parents ec0c824 + 5eddfe7 commit 4cc0465
Show file tree
Hide file tree
Showing 19 changed files with 58 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
variables:
Codeql.SkipTaskAutoInjection: true
skipComponentGovernanceDetection: true
container: ccfmsrc.azurecr.io/ccf/ci:2024-04-25-virtual-clang15
container: ccfmsrc.azurecr.io/ccf/ci:2024-05-29-virtual-clang15
pool:
vmImage: ubuntu-20.04

Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines-model-checking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ schedules:
resources:
containers:
- container: virtual
image: ccfmsrc.azurecr.io/ccf/ci:2024-04-25-virtual-clang15
image: ccfmsrc.azurecr.io/ccf/ci:2024-05-29-virtual-clang15
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE

jobs:
Expand Down
6 changes: 3 additions & 3 deletions .azure-pipelines-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ pr: none
resources:
containers:
- container: virtual
image: ccfmsrc.azurecr.io/ccf/ci:2024-04-25-virtual-clang15
image: ccfmsrc.azurecr.io/ccf/ci:2024-05-29-virtual-clang15
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro

- container: snp
image: ccfmsrc.azurecr.io/ccf/ci:2024-04-25-snp-clang15
image: ccfmsrc.azurecr.io/ccf/ci:2024-05-29-snp-clang15
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro

- container: sgx
image: ccfmsrc.azurecr.io/ccf/ci:2024-04-25-sgx
image: ccfmsrc.azurecr.io/ccf/ci:2024-05-29-sgx
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --device /dev/sgx_enclave:/dev/sgx_enclave --device /dev/sgx_provision:/dev/sgx_provision -v /dev/sgx:/dev/sgx -v /lib/modules:/lib/modules:ro

variables:
Expand Down
4 changes: 2 additions & 2 deletions .azure-pipelines-templates/deploy_aci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- script: |
set -ex
docker login -u $ACR_TOKEN_NAME -p $ACR_CI_PUSH_TOKEN_PASSWORD $ACR_REGISTRY
docker pull $ACR_REGISTRY/ccf/ci:2024-04-25-snp-clang15
docker pull $ACR_REGISTRY/ccf/ci:2024-05-29-snp-clang15
docker build -f docker/ccf_ci_built . --build-arg="base=$BASE_IMAGE" --build-arg="platform=snp" -t $ACR_REGISTRY/ccf/ci:pr-`git rev-parse HEAD`
docker push $ACR_REGISTRY/ccf/ci:pr-`git rev-parse HEAD`
name: build_ci_image
Expand All @@ -63,7 +63,7 @@ jobs:
ACR_TOKEN_NAME: ci-push-token
ACR_CI_PUSH_TOKEN_PASSWORD: $(ACR_CI_PUSH_TOKEN_PASSWORD)
ACR_REGISTRY: ccfmsrc.azurecr.io
BASE_IMAGE: ccfmsrc.azurecr.io/ccf/ci:2024-04-25-snp-clang15
BASE_IMAGE: ccfmsrc.azurecr.io/ccf/ci:2024-05-29-snp-clang15
- script: |
set -ex
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines-templates/test_on_remote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
set -ex
cd /CCF/build
npm config set cache /ccfci/workspace_$(Build.BuildNumber)/.npm
WORKSPACE=/ccfci/workspace_$(Build.BuildNumber) ELECTION_TIMEOUT_MS=10000 ./tests.sh -VV -T Test -LE "benchmark|perf|tlstest|vegeta|suite" -E "lts_compatibility"
WORKSPACE=/ccfci/workspace_$(Build.BuildNumber) ELECTION_TIMEOUT_MS=10000 ./tests.sh -VV -T Test -LE "benchmark|perf|tlstest|vegeta|suite|snp_flaky" -E "lts_compatibility"
# Remove irrelevant and bulky data from workspace before uploading
find /ccfci/workspace_$(Build.BuildNumber) -type f -name cchost -delete
find /ccfci/workspace_$(Build.BuildNumber) -type f -name "*.so" -delete
Expand Down
6 changes: 3 additions & 3 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ schedules:
resources:
containers:
- container: virtual
image: ccfmsrc.azurecr.io/ccf/ci:2024-04-25-virtual-clang15
image: ccfmsrc.azurecr.io/ccf/ci:2024-05-29-virtual-clang15
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro

- container: snp
image: ccfmsrc.azurecr.io/ccf/ci:2024-04-25-snp-clang15
image: ccfmsrc.azurecr.io/ccf/ci:2024-05-29-snp-clang15
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro

- container: sgx
image: ccfmsrc.azurecr.io/ccf/ci:2024-04-25-sgx
image: ccfmsrc.azurecr.io/ccf/ci:2024-05-29-sgx
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --device /dev/sgx_enclave:/dev/sgx_enclave --device /dev/sgx_provision:/dev/sgx_provision -v /dev/sgx:/dev/sgx -v /lib/modules:/lib/modules:ro

variables:
Expand Down
2 changes: 1 addition & 1 deletion .azure_pipelines_snp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ schedules:
resources:
containers:
- container: virtual
image: ccfmsrc.azurecr.io/ccf/ci:2024-04-25-virtual-clang15
image: ccfmsrc.azurecr.io/ccf/ci:2024-05-29-virtual-clang15
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro

jobs:
Expand Down
6 changes: 3 additions & 3 deletions .daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ schedules:
resources:
containers:
- container: virtual
image: ccfmsrc.azurecr.io/ccf/ci:2024-04-25-virtual-clang15
image: ccfmsrc.azurecr.io/ccf/ci:2024-05-29-virtual-clang15
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE

- container: snp
image: ccfmsrc.azurecr.io/ccf/ci:2024-04-25-snp-clang15
image: ccfmsrc.azurecr.io/ccf/ci:2024-05-29-snp-clang15
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro

- container: sgx
image: ccfmsrc.azurecr.io/ccf/ci:2024-04-25-sgx
image: ccfmsrc.azurecr.io/ccf/ci:2024-05-29-sgx
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --device /dev/sgx_enclave:/dev/sgx_enclave --device /dev/sgx_provision:/dev/sgx_provision -v /dev/sgx:/dev/sgx

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "CCF Development Environment",
"image": "ccfmsrc.azurecr.io/ccf/ci:2024-04-25-virtual-clang15",
"image": "ccfmsrc.azurecr.io/ccf/ci:2024-05-29-virtual-clang15",
"runArgs": [],
"extensions": [
"eamodio.gitlens",
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/bencher_process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:

jobs:
process_benchmarks:
name: Process benchmarks
permissions:
pull-requests: write
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
env:
Expand All @@ -16,7 +19,7 @@ jobs:

steps:
- name: Download Benchmark Results
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
async function downloadArtifact(artifactName) {
Expand Down Expand Up @@ -50,7 +53,7 @@ jobs:
- name: Export PR Event Data
id: export
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
let fs = require('fs');
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bencher_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Continuous Benchmarking with Bencher
runs-on: [self-hosted, 1ES.Pool=gha-virtual-ccf-sub]
container:
image: ccfmsrc.azurecr.io/ccf/ci:2024-04-25-virtual-clang15
image: ccfmsrc.azurecr.io/ccf/ci:2024-05-29-virtual-clang15
steps:
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions: read-all
jobs:
checks:
runs-on: ubuntu-latest
container: ccfmsrc.azurecr.io/ccf/ci:2024-04-25-virtual-clang15
container: ccfmsrc.azurecr.io/ccf/ci:2024-05-29-virtual-clang15

steps:
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tlaplus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
name: Model Checking - Consistency
runs-on: [self-hosted, 1ES.Pool=gha-virtual-ccf-sub]
container:
image: ccfmsrc.azurecr.io/ccf/ci:2024-04-25-virtual-clang15
image: ccfmsrc.azurecr.io/ccf/ci:2024-05-29-virtual-clang15

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .multi-thread.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pr:
resources:
containers:
- container: virtual
image: ccfmsrc.azurecr.io/ccf/ci:2024-04-25-virtual-clang15
image: ccfmsrc.azurecr.io/ccf/ci:2024-05-29-virtual-clang15
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .stress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ schedules:
resources:
containers:
- container: sgx
image: ccfmsrc.azurecr.io/ccf/ci:2024-04-25-sgx
image: ccfmsrc.azurecr.io/ccf/ci:2024-05-29-sgx
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --device /dev/sgx_enclave:/dev/sgx_enclave --device /dev/sgx_provision:/dev/sgx_provision -v /dev/sgx:/dev/sgx

jobs:
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1389,7 +1389,9 @@ if(BUILD_TESTS)
)

add_e2e_test(
NAME jwt_test PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/jwt_test.py
NAME jwt_test
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/jwt_test.py
LABEL snp_flaky
)

add_e2e_test(
Expand Down Expand Up @@ -1486,6 +1488,7 @@ if(BUILD_TESTS)
add_e2e_test(
NAME consistency_trace_validation
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/consistency_trace_validation.py
LABEL snp_flaky
)

add_e2e_test(
Expand Down
2 changes: 1 addition & 1 deletion docker/ccf_ci_built
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Latest image as of this change
ARG platform=sgx
ARG base=ccfmsrc.azurecr.io/ccf/ci:2024-04-25-snp-clang-15
ARG base=ccfmsrc.azurecr.io/ccf/ci:2024-05-29-snp-clang-15
FROM ${base}

# SSH. Note that this could (should) be done in the base ccf_ci image instead
Expand Down
2 changes: 1 addition & 1 deletion scripts/azure_deployment/arm_aci.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def parse_aci_args(parser: ArgumentParser) -> Namespace:
"--aci-image",
help="The name of the image to deploy in the ACI",
type=str,
default="ccfmsrc.azurecr.io/ccf/ci:2024-04-25-snp",
default="ccfmsrc.azurecr.io/ccf/ci:2024-05-29-snp",
)
parser.add_argument(
"--aci-type",
Expand Down
30 changes: 26 additions & 4 deletions tests/js-modules/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,8 @@ def rand_bytes(n):
return bytes(random.getrandbits(8) for _ in range(n))


@reqs.description("Test basic Node.js/npm app")
def build_and_deploy_npm_app(network, args):
@reqs.description("Build basic Node.js/npm app")
def build_npm_app(network, args):
primary, _ = network.find_nodes()

LOG.info("Building ccf-app npm package (dependency)")
Expand All @@ -483,6 +483,15 @@ def build_and_deploy_npm_app(network, args):
== 0
)

return network


@reqs.description("Deploy basic Node.js/npm app")
def deploy_npm_app(network, args):
primary, _ = network.find_nodes()

app_dir = os.path.join(PARENT_DIR, "npm-app")

LOG.info("Deploying npm app")
bundle_path = os.path.join(
app_dir, "dist", "bundle.json"
Expand Down Expand Up @@ -1337,6 +1346,8 @@ def test_js_execution_time(network, args):

@reqs.description("Test JS exception output")
def test_js_exception_output(network, args):
network = deploy_npm_app(network, args)

primary, _ = network.find_nodes()

with primary.client("user0") as c:
Expand Down Expand Up @@ -1436,15 +1447,26 @@ def run(args):
args.nodes, args.binary_dir, args.debug_nodes, args.perf_nodes, pdb=args.pdb
) as network:
network.start_and_open(args)

# Needs to happen early, so later tests can deploy it if they want to
network = build_npm_app(network, args)

# Needs to happen before any other call to set_js_runtime_options
# to properly test the default values, which should not emit
# error details on response (or in the log).
network = test_js_exception_output(network, args)

network = test_module_import(network, args)
network = test_bytecode_cache(network, args)
network = test_app_bundle(network, args)
network = test_dynamic_endpoints(network, args)
network = test_set_js_runtime(network, args)
network = build_and_deploy_npm_app(network, args)

# Remaining tests all require this app, and its endpoints
network = deploy_npm_app(network, args)

network = test_npm_app(network, args)
network = test_js_execution_time(network, args)
network = test_js_exception_output(network, args)
network = test_user_cose_authentication(network, args)
network = test_multi_auth(network, args)

Expand Down

0 comments on commit 4cc0465

Please sign in to comment.