Skip to content

Commit

Permalink
Exclude libevent due to errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nhatnghiho committed Feb 3, 2025
1 parent c667fb9 commit 80f28d5
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .github/workflows/integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,19 @@ jobs:
- name: Run openvpn build main
run: |
./tests/ci/integration/run_openvpn_integration.sh master
libevent:
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
steps:
- name: Install OS Dependencies
run: |
sudo apt-get update -o Acquire::Languages=none -o Acquire::Translation=none
sudo apt-get -y --no-install-recommends install \
cmake gcc ninja-build golang
- uses: actions/checkout@v4
- name: Run libevent build
run: |
./tests/ci/integration/run_libevent_integration.sh
ruby-releases:
if: github.repository_owner == 'aws'
strategy:
Expand Down
3 changes: 2 additions & 1 deletion tests/ci/cdk/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from cdk.aws_lc_android_ci_stack import AwsLcAndroidCIStack
from cdk.aws_lc_github_ci_stack import AwsLcGitHubCIStack
from cdk.aws_lc_github_fuzz_ci_stack import AwsLcGitHubFuzzCIStack
from cdk.aws_lc_github_integration_ci_stack import AwsLcGitHubIntegrationCIStack
from cdk.aws_lc_ec2_test_framework_ci_stack import AwsLcEC2TestingCIStack
from cdk.linux_docker_image_batch_build_stack import LinuxDockerImageBatchBuildStack
from cdk.windows_docker_image_build_stack import WindowsDockerImageBuildStack
Expand Down Expand Up @@ -41,7 +42,7 @@
arm_build_spec_file = "cdk/codebuild/github_ci_linux_arm_omnibus.yaml"
AwsLcGitHubCIStack(app, "aws-lc-ci-linux-arm", arm_build_spec_file, env=env)
integration_build_spec_file = "cdk/codebuild/github_ci_integration_omnibus.yaml"
AwsLcGitHubCIStack(app, "aws-lc-ci-integration", integration_build_spec_file, env=env)
AwsLcGitHubIntegrationCIStack(app, "aws-lc-ci-integration", integration_build_spec_file, env=env)
win_x86_build_spec_file = "cdk/codebuild/github_ci_windows_x86_omnibus.yaml"
AwsLcGitHubCIStack(app, "aws-lc-ci-windows-x86", win_x86_build_spec_file, env=env)
fuzz_build_spec_file = "cdk/codebuild/github_ci_fuzzing_omnibus.yaml"
Expand Down
95 changes: 95 additions & 0 deletions tests/ci/cdk/cdk/aws_lc_github_integration_ci_stack.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0 OR ISC

from aws_cdk import Duration, Stack, aws_ec2 as ec2, aws_codebuild as codebuild, aws_iam as iam, aws_s3_assets, aws_logs as logs
from constructs import Construct

from cdk.components import PruneStaleGitHubBuilds
from util.iam_policies import code_build_batch_policy_in_json, code_build_publish_metrics_in_json, code_build_cloudwatch_logs_policy_in_json
from util.metadata import CAN_AUTOLOAD, GITHUB_PUSH_CI_BRANCH_TARGETS, GITHUB_REPO_OWNER, GITHUB_REPO_NAME
from util.build_spec_loader import BuildSpecLoader


class AwsLcGitHubIntegrationCIStack(Stack):
"""Define a stack used to batch execute AWS-LC tests in GitHub."""

def __init__(self,
scope: Construct,
id: str,
spec_file_path: str,
**kwargs) -> None:
super().__init__(scope, id, **kwargs)

# Define CodeBuild resource.
git_hub_source = codebuild.Source.git_hub(
owner=GITHUB_REPO_OWNER,
repo=GITHUB_REPO_NAME,
webhook=True,
webhook_filters=[
codebuild.FilterGroup.in_event_of(
codebuild.EventAction.PULL_REQUEST_CREATED,
codebuild.EventAction.PULL_REQUEST_UPDATED,
codebuild.EventAction.PULL_REQUEST_REOPENED),
codebuild.FilterGroup.in_event_of(codebuild.EventAction.PUSH).and_branch_is(
GITHUB_PUSH_CI_BRANCH_TARGETS),
],
webhook_triggers_batch_build=True)

# Define a IAM role for accessing build resources
log_group = logs.LogGroup(self, id="{}-public-logs".format(id))
code_build_cloudwatch_logs_policy = iam.PolicyDocument.from_json(
code_build_cloudwatch_logs_policy_in_json([log_group])
)
resource_access_role = iam.Role(scope=self,
id="{}-resource-role".format(id),
assumed_by=iam.ServicePrincipal("codebuild.amazonaws.com"),
inline_policies={
"code_build_cloudwatch_logs_policy": code_build_cloudwatch_logs_policy
})

# Define a IAM role for this stack.
code_build_batch_policy = iam.PolicyDocument.from_json(
code_build_batch_policy_in_json([id])
)
metrics_policy = iam.PolicyDocument.from_json(code_build_publish_metrics_in_json())
inline_policies = {"code_build_batch_policy": code_build_batch_policy,
"metrics_policy": metrics_policy,
}
role = iam.Role(scope=self,
id="{}-role".format(id),
assumed_by=iam.ServicePrincipal("codebuild.amazonaws.com"),
inline_policies=inline_policies)

logging_options = codebuild.LoggingOptions(
cloud_watch=codebuild.CloudWatchLoggingOptions(
log_group=log_group
)
)

vpc = ec2.Vpc(scope=self,
id="{}-ec2-vpc".format(id))

# Assign an IPv6 CIDR block to VPC
ec2.CfnVPCCidrBlock(scope=self, id="{}-vpc-cidr-block", vpc_id=vpc.vpc_id, amazon_provided_ipv6_cidr_block=True)

# Define CodeBuild.
project = codebuild.Project(
scope=self,
id=id,
project_name=id,
source=git_hub_source,
role=role,
vpc=vpc,
timeout=Duration.minutes(180),
logging=logging_options,
environment=codebuild.BuildEnvironment(compute_type=codebuild.ComputeType.SMALL,
privileged=False,
build_image=codebuild.LinuxBuildImage.STANDARD_6_0),
build_spec=BuildSpecLoader.load(spec_file_path))

cfn_project = project.node.default_child
cfn_project.add_property_override("Visibility", "PUBLIC_READ")
cfn_project.add_property_override("ResourceAccessRole", resource_access_role.role_arn)
project.enable_batch_builds()

PruneStaleGitHubBuilds(scope=self, id="PruneStaleGitHubBuilds", project=project, ec2_permissions=False)
18 changes: 18 additions & 0 deletions tests/ci/codebuild/linux-x86/run_ipv6_target.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0 OR ISC

version: 0.2

env:
variables:
GOPROXY: https://proxy.golang.org,direct

phases:
pre_build:
commands:
- sysctl -w net.ipv6.conf.all.disable_ipv6=0
- sysctl -w net.ipv6.conf.default.disable_ipv6=0
- sysctl -w net.ipv6.conf.lo.disable_ipv6=0
build:
commands:
- "./${AWS_LC_CI_TARGET}"

0 comments on commit 80f28d5

Please sign in to comment.