Skip to content

Commit acc0c86

Browse files
committed
test python
1 parent 71613db commit acc0c86

File tree

3 files changed

+11
-32
lines changed

3 files changed

+11
-32
lines changed

.github/workflows/python-ec2-canary.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
aws-region: ['af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1',
24-
'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1',
25-
'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1',
26-
'us-east-1','us-east-2', 'us-west-1', 'us-west-2']
23+
aws-region: ['us-east-2']
2724
uses: ./.github/workflows/python-ec2-default-retry.yml
2825
secrets: inherit
2926
with:

.github/workflows/python-ec2-default-test.yml

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ env:
4949
CPU_ARCHITECTURE: ${{ inputs.cpu-architecture }}
5050
ADOT_WHEEL_NAME: ${{ inputs.staging-wheel-name }}
5151
OTEL_SOURCE: ${{ inputs.otel-source }}
52-
SAMPLE_APP_ZIP: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/python-sample-app.zip
52+
SAMPLE_APP_ZIP: s3://aws-appsignals-sample-app-zmengyi-${{ inputs.aws-region }}/python-sample-app.zip
5353
E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}
5454
E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
55+
ACCOUNT_ID: 633750930120
5556
METRIC_NAMESPACE: ApplicationSignals
5657
LOG_GROUP_NAME: /aws/application-signals/data
5758
TEST_RESOURCES_FOLDER: ${GITHUB_WORKSPACE}
@@ -95,12 +96,6 @@ jobs:
9596
role-to-assume: arn:aws:iam::${{ env.E2E_TEST_ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }}
9697
aws-region: us-east-1
9798

98-
- name: Retrieve account
99-
uses: aws-actions/aws-secretsmanager-get-secrets@v1
100-
with:
101-
secret-ids:
102-
ACCOUNT_ID, region-account/${{ env.E2E_TEST_AWS_REGION }}
103-
10499
- name: Configure AWS Credentials
105100
if: ${{ github.event.repository.name == 'aws-application-signals-test-framework' }}
106101
uses: aws-actions/configure-aws-credentials@v4
@@ -110,30 +105,11 @@ jobs:
110105

111106
- name: Set Get ADOT Wheel command environment variable
112107
run: |
113-
if [ "${{ github.event.repository.name }}" = "aws-otel-python-instrumentation" ]; then
114-
# Reusing the adot-main-build-staging-jar bucket to store the python wheel file
115-
echo GET_ADOT_WHEEL_COMMAND="aws s3 cp s3://adot-main-build-staging-jar/${{ env.ADOT_WHEEL_NAME }} ./${{ env.ADOT_WHEEL_NAME }} && sudo python${{ env.PYTHON_VERSION }} -m pip install ${{ env.ADOT_WHEEL_NAME }}" >> $GITHUB_ENV
116-
elif [ "${{ env.OTEL_SOURCE }}" == "pypi" ]; then
117-
echo GET_ADOT_WHEEL_COMMAND="sudo python${{ env.PYTHON_VERSION }} -m pip install ${{ env.ADOT_WHEEL_NAME }}" >> $GITHUB_ENV
118-
else
119-
latest_release_version=$(curl -sL https://github.com/aws-observability/aws-otel-python-instrumentation/releases/latest | grep -oP '/releases/tag/v\K[0-9]+\.[0-9]+\.[0-9]+' | head -n 1)
120-
echo "The latest version is $latest_release_version"
121-
echo GET_ADOT_WHEEL_COMMAND="wget -O ${{ env.ADOT_WHEEL_NAME }} https://github.com/aws-observability/aws-otel-python-instrumentation/releases/latest/download/aws_opentelemetry_distro-$latest_release_version-py3-none-any.whl \
122-
&& sudo python${{ env.PYTHON_VERSION }} -m pip install ${{ env.ADOT_WHEEL_NAME }}" >> $GITHUB_ENV
123-
fi
108+
echo GET_ADOT_WHEEL_COMMAND="aws s3 cp s3://adot-build/aws_opentelemetry_distro-0.5.0.dev0-py3-none-any.whl ./${{ env.ADOT_WHEEL_NAME }} && sudo python${{ env.PYTHON_VERSION }} -m pip install ${{ env.ADOT_WHEEL_NAME }}" >> $GITHUB_ENV
124109
125110
- name: Set Get CW Agent command environment variable
126111
run: |
127-
if [ "${{ github.event.repository.name }}" = "amazon-cloudwatch-agent" ]; then
128-
# Reusing the adot-main-build-staging-jar bucket to store the python wheel file
129-
echo GET_CW_AGENT_RPM_COMMAND= "aws s3 cp s3://${{ secrets.S3_INTEGRATION_BUCKET }}/integration-test/binary/${{ github.sha }}/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm ./cw-agent.rpm" >> $GITHUB_ENV
130-
else
131-
if [ "${{ env.CPU_ARCHITECTURE }}" = "x86_64" ]; then
132-
echo GET_CW_AGENT_RPM_COMMAND="wget -O cw-agent.rpm https://amazoncloudwatch-agent-${{ inputs.aws-region }}.s3.${{ inputs.aws-region }}.amazonaws.com/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm" >> $GITHUB_ENV
133-
elif [ "${{ env.CPU_ARCHITECTURE }}" = "arm64" ]; then
134-
echo GET_CW_AGENT_RPM_COMMAND="wget -O cw-agent.rpm https://amazoncloudwatch-agent-${{ inputs.aws-region }}.s3.${{ inputs.aws-region }}.amazonaws.com/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm" >> $GITHUB_ENV
135-
fi
136-
fi
112+
echo GET_CW_AGENT_RPM_COMMAND= "aws s3 cp s3://amazon-cloudwatch-agent-build/amazon-cloudwatch-agent.rpm ./cw-agent.rpm" >> $GITHUB_ENV
137113
138114
- name: Set up terraform
139115
uses: ./.github/workflows/actions/execute_and_retry

terraform/python/ec2/default/main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ resource "null_resource" "main_service_setup" {
136136
sudo dnf install -y python${var.language_version}-pip
137137
fi
138138
139+
# enable ec2 instance connect for debug
140+
sudo yum install ec2-instance-connect -y
141+
139142
# Copy in CW Agent configuration
140143
agent_config='${replace(replace(file("./amazon-cloudwatch-agent.json"), "/\\s+/", ""), "$REGION", var.aws_region)}'
141144
echo $agent_config > amazon-cloudwatch-agent.json
@@ -258,6 +261,9 @@ resource "null_resource" "remote_service_setup" {
258261
sudo dnf install -y python${var.language_version}-pip
259262
fi
260263
264+
# enable ec2 instance connect for debug
265+
sudo yum install ec2-instance-connect -y
266+
261267
# Copy in CW Agent configuration
262268
agent_config='${replace(replace(file("./amazon-cloudwatch-agent.json"), "/\\s+/", ""), "$REGION", var.aws_region)}'
263269
echo $agent_config > amazon-cloudwatch-agent.json

0 commit comments

Comments
 (0)