Skip to content

Fix CI #429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ jobs:
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
with:
license_header_check_project_name: "SwiftAWSLambdaRuntime"
shell_check_enabled: false
python_lint_check_enabled: false
shell_check_enabled: true
python_lint_check_enabled: true
api_breakage_check_container_image: "swift:6.0-noble"
docs_check_container_image: "swift:6.0-noble"
format_check_container_image: "swiftlang/swift:nightly-6.0-jammy"
yamllint_check_enabled: true

unit-tests:
name: Unit tests
Expand Down Expand Up @@ -43,6 +44,18 @@ jobs:
name: Swift 6 Language Mode
uses: apple/swift-nio/.github/workflows/swift_6_language_mode.yml@main

semver-label-check:
name: Semantic Version label check
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Check for Semantic Version label
uses: apple/swift-nio/.github/actions/pull_request_semver_label_checker@main

# until there is a support for musl in swiftlang/github-workflows
# https://github.com/swiftlang/github-workflows/issues/34
musl:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# shellcheck disable=all
# Create a project directory
mkdir SquareNumber && cd SquareNumber
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# shellcheck disable=all
# Create a project directory
mkdir SquareNumber && cd SquareNumber
# create a skeleton project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# shellcheck disable=all
# Create a project directory
mkdir SquareNumber && cd SquareNumber
# create a skeleton project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# shellcheck disable=all
# Create a project directory
mkdir SquareNumber && cd SquareNumber
# create a skeleton project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# shellcheck disable=all

2023-04-14T11:42:21+0200 info LocalLambdaServer : [AWSLambdaRuntimeCore] LocalLambdaServer started and listening on 127.0.0.1:7000, receiving events on /invoke
2023-04-14T11:42:21+0200 info Lambda : [AWSLambdaRuntimeCore] lambda runtime starting with LambdaConfiguration
General(logLevel: info))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# shellcheck disable=all

curl --header "Content-Type: application/json" \
--request POST \
--data '{"number": 3}' \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# shellcheck disable=all

curl --header "Content-Type: application/json" \
--request POST \
--data '{"number": 3}' \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export LOCAL_LAMBDA_SERVER_ENABLED=true
# shellcheck disable=all

export LOCAL_LAMBDA_SERVER_ENABLED=true
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# shellcheck disable=all

export LOCAL_LAMBDA_SERVER_ENABLED=true
swift run
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# shellcheck disable=all

export LOCAL_LAMBDA_SERVER_ENABLED=true
swift run

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# shellcheck disable=all

swift package archive --allow-network-connections docker

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# shellcheck disable=all

swift package archive --allow-network-connections docker

-------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# shellcheck disable=all

swift package archive --allow-network-connections docker

-------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# shellcheck disable=all

aws --version
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# shellcheck disable=all

#
# --region the AWS Region to send the command
# --function-name the name of your function
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# shellcheck disable=all

#
# --region the AWS Region to send the command
# --function-name the name of your function
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# shellcheck disable=all

#
# --region the AWS Region to send the command
# --function-name the name of your function
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# shellcheck disable=all

#
# --region the AWS Region to send the command
# --function-name the name of your function
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# shellcheck disable=all

#
# --region the AWS Region to send the command
# --function-name the name of your function
Expand Down
7 changes: 2 additions & 5 deletions scripts/integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ fatal() { error "$@"; exit 1; }
test -n "${SWIFT_VERSION:-}" || fatal "SWIFT_VERSION unset"
test -n "${COMMAND:-}" || fatal "COMMAND unset"
test -n "${EXAMPLE:-}" || fatal "EXAMPLE unset"
swift_version="$SWIFT_VERSION"
command="$COMMAND"
example="$EXAMPLE"

pushd Examples/"$example" > /dev/null
pushd Examples/"$EXAMPLE" > /dev/null

log "Running command with Swift $SWIFT_VERSION"
eval "$command"
eval "$COMMAND"

popd
8 changes: 4 additions & 4 deletions scripts/linux_performance_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ apt-get install -y vim htop strace linux-tools-common linux-tools-generic libc6-

echo 0 > /proc/sys/kernel/kptr_restrict

cd /usr/bin
pushd /usr/bin || exit 1
rm -rf perf
ln -s /usr/lib/linux-tools/*/perf perf
cd -
popd || exit 1

cd /opt
pushd /opt || exit 1
git clone https://github.com/brendangregg/FlameGraph.git
cd -
popd || exit 1

# build the code in relase mode with debug symbols
# swift build -c release -Xswiftc -g
Expand Down
34 changes: 17 additions & 17 deletions scripts/performance_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ if [[ $(uname -s) == "Linux" ]]; then
fi

swift build -c release -Xswiftc -g
swift build --package-path Examples/Echo -c release -Xswiftc -g
swift build --package-path Examples/JSON -c release -Xswiftc -g
LAMBDA_USE_LOCAL_DEPS=../.. swift build --package-path Examples/HelloWorld -c release -Xswiftc -g
LAMBDA_USE_LOCAL_DEPS=../.. swift build --package-path Examples/HelloJSON -c release -Xswiftc -g

cleanup() {
kill -9 $server_pid # ignore-unacceptable-language
Expand Down Expand Up @@ -58,24 +58,24 @@ kill -0 $server_pid # check server is alive # ignore-unacceptable-language
echo "running $MODE mode cold test"
cold=()
export MAX_REQUESTS=1
for (( i=0; i<$cold_iterations; i++ )); do
for (( i=0; i<cold_iterations; i++ )); do
start=$(gdate +%s%N)
./Examples/Echo/.build/release/MyLambda
./Examples/HelloWorld/.build/release/MyLambda
end=$(gdate +%s%N)
cold+=( $(($end-$start)) )
cold+=( $((end-start)) )
done
sum_cold=$(IFS=+; echo "$((${cold[*]}))")
avg_cold=$(($sum_cold/$cold_iterations))
avg_cold=$((sum_cold/cold_iterations))
results+=( "$MODE, cold: $avg_cold (ns)" )

# normal calls
echo "running $MODE mode warm test"
export MAX_REQUESTS=$warm_iterations
start=$(gdate +%s%N)
./Examples/Echo/.build/release/MyLambda
./Examples/HelloWorld/.build/release/MyLambda
end=$(gdate +%s%N)
sum_warm=$(($end-$start-$avg_cold)) # substract by avg cold since the first call is cold
avg_warm=$(($sum_warm/($warm_iterations-1))) # substract since the first call is cold
sum_warm=$((end-start-avg_cold)) # substract by avg cold since the first call is cold
avg_warm=$((sum_warm/(warm_iterations-1))) # substract since the first call is cold
results+=( "$MODE, warm: $avg_warm (ns)" )

#------------------
Expand All @@ -96,32 +96,32 @@ kill -0 $server_pid # check server is alive # ignore-unacceptable-language
echo "running $MODE mode cold test"
cold=()
export MAX_REQUESTS=1
for (( i=0; i<$cold_iterations; i++ )); do
for (( i=0; i<cold_iterations; i++ )); do
start=$(gdate +%s%N)
./Examples/JSON/.build/release/MyLambda
./Examples/HelloJSON/.build/release/MyLambda
end=$(gdate +%s%N)
cold+=( $(($end-$start)) )
cold+=( $((end-start)) )
done
sum_cold=$(IFS=+; echo "$((${cold[*]}))")
avg_cold=$(($sum_cold/$cold_iterations))
avg_cold=$((sum_cold/cold_iterations))
results+=( "$MODE, cold: $avg_cold (ns)" )

# normal calls
echo "running $MODE mode warm test"
export MAX_REQUESTS=$warm_iterations
start=$(gdate +%s%N)
./Examples/JSON/.build/release/MyLambda
./Examples/HelloJSON/.build/release/MyLambda
end=$(gdate +%s%N)
sum_warm=$(($end-$start-$avg_cold)) # substract by avg cold since the first call is cold
avg_warm=$(($sum_warm/($warm_iterations-1))) # substract since the first call is cold
sum_warm=$((end-start-avg_cold)) # substract by avg cold since the first call is cold
avg_warm=$((sum_warm/(warm_iterations-1))) # substract since the first call is cold
results+=( "$MODE, warm: $avg_warm (ns)" )

# print results
echo "-----------------------------"
echo "results"
echo "-----------------------------"
for i in "${results[@]}"; do
echo $i
echo "$i"
done
echo "-----------------------------"

Expand Down