Skip to content
This repository was archived by the owner on Oct 20, 2021. It is now read-only.

Commit de030bd

Browse files
author
Paul Balaji
authored
New Buildkite instrumentation format (#276)
1 parent d92c5f7 commit de030bd

File tree

6 files changed

+78
-70
lines changed

6 files changed

+78
-70
lines changed

ci/bootstrap.sh

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,34 @@
22
set -e -u -o pipefail
33

44
if [[ -n "${DEBUG-}" ]]; then
5-
set -x
5+
set -x
66
fi
77

88
function isLinux() {
9-
[[ "$(uname -s)" == "Linux" ]];
9+
[[ "$(uname -s)" == "Linux" ]];
1010
}
1111

1212
function isMacOS() {
13-
[[ "$(uname -s)" == "Darwin" ]];
13+
[[ "$(uname -s)" == "Darwin" ]];
1414
}
1515

1616
function isWindows() {
17-
! ( isLinux || isMacOS );
17+
! ( isLinux || isMacOS );
1818
}
1919

2020
cd "$(dirname "$0")/../"
2121

22-
echo "--- Bootstrapping :boot:"
22+
echo "## imp-ci group-start Bootstrapping :boot:"
2323

2424
./ci/get-shared-ci.sh
25+
source ".shared-ci/scripts/pinned-tools.sh"
2526

2627
# Clone the GDK for Unity repository
2728

2829
CLONE_URI="[email protected]:spatialos/gdk-for-unity.git"
2930
pushd ../
3031
TARGET_DIRECTORY="$(pwd)/gdk-for-unity"
31-
popd
32+
popd
3233
PINNED_BRANCH=$(cat ./gdk.pinned | cut -d' ' -f 1)
3334
PINNED_VERSION=$(cat ./gdk.pinned | cut -d' ' -f 2)
3435
SKIP_GDK=false
@@ -58,30 +59,36 @@ if [ "$SKIP_GDK" = false ] ; then
5859
git remote add origin "${CLONE_URI}"
5960
git fetch --depth 20 origin "${PINNED_BRANCH}"
6061
git checkout "${PINNED_VERSION}"
61-
echo "--- Hit init :right-facing_fist::red_button:"
62-
./init.sh $@
62+
63+
traceStart "Hit init :right-facing_fist::red_button:"
64+
./init.sh $@
65+
traceEnd
6366
popd
6467
fi
6568

66-
echo "--- Symlinking packages :link::package:"
67-
68-
if isWindows; then
69-
if [[ -z ${BUILDKITE:-} ]]; then
70-
powershell Start-Process -Verb RunAs -WindowStyle Hidden -Wait -FilePath dotnet.exe -ArgumentList "run", "-p", "$(pwd)/.shared-ci/tools/PackageSymLinker/PackageSymLinker.csproj", "\-\-", "--packages-source-dir", "${TARGET_DIRECTORY}/workers/unity/Packages", "--package-target-dir", "$(pwd)/workers/unity/Packages"
71-
exit 0
69+
traceStart "Symlinking packages :link::package:"
70+
if isWindows; then
71+
if [[ -z ${BUILDKITE:-} ]]; then
72+
powershell Start-Process -Verb RunAs -WindowStyle Hidden -Wait -FilePath dotnet.exe -ArgumentList "run", "-p", "$(pwd)/.shared-ci/tools/PackageSymLinker/PackageSymLinker.csproj", "\-\-", "--packages-source-dir", "${TARGET_DIRECTORY}/workers/unity/Packages", "--package-target-dir", "$(pwd)/workers/unity/Packages"
73+
traceEnd
74+
echo "## imp-ci group-end Bootstrapping :boot:"
75+
exit 0
76+
fi
7277
fi
73-
fi
7478

75-
EXTRA_ARGS=""
79+
EXTRA_ARGS=""
7680

77-
if [[ -n ${BUILDKITE:-} ]]; then
78-
EXTRA_ARGS="--copy"
79-
fi
81+
if [[ -n ${BUILDKITE:-} ]]; then
82+
EXTRA_ARGS="--copy"
83+
fi
8084

81-
if [[ "${BUILDKITE_AGENT_META_DATA_OS:-}" == "darwin" ]]; then
82-
PATH="${PATH}:/usr/local/share/dotnet"
83-
fi
85+
if [[ "${BUILDKITE_AGENT_META_DATA_OS:-}" == "darwin" ]]; then
86+
PATH="${PATH}:/usr/local/share/dotnet"
87+
fi
88+
89+
dotnet run -p ./.shared-ci/tools/PackageSymLinker/PackageSymLinker.csproj -- \
90+
--packages-source-dir "${TARGET_DIRECTORY}/workers/unity/Packages" \
91+
--package-target-dir "$(pwd)/workers/unity/Packages" "${EXTRA_ARGS}"
92+
traceEnd
8493

85-
dotnet run -p ./.shared-ci/tools/PackageSymLinker/PackageSymLinker.csproj -- \
86-
--packages-source-dir "${TARGET_DIRECTORY}/workers/unity/Packages" \
87-
--package-target-dir "$(pwd)/workers/unity/Packages" "${EXTRA_ARGS}"
94+
echo "## imp-ci group-end Bootstrapping :boot:"

ci/get-shared-ci.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -e -u -o pipefail
33

44
if [[ -n "${DEBUG-}" ]]; then
5-
set -x
5+
set -x
66
fi
77

88
SHARED_CI_DIR="$(pwd)/.shared-ci"

ci/launch.sh

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,56 @@
33
set -e -u -o pipefail
44

55
if [[ -n "${DEBUG-}" ]]; then
6-
set -x
6+
set -x
77
fi
88

99
cd "$(dirname "$0")/../"
1010

1111
source ".shared-ci/scripts/pinned-tools.sh"
1212

1313
# Download the artifacts and reconstruct the build/assemblies folder.
14-
echo "--- Downloading assembly :inbox_tray:"
15-
buildkite-agent artifact download "build\assembly\**\*" .
14+
traceStart "Downloading assembly :inbox_tray:"
15+
buildkite-agent artifact download "build\assembly\**\*" .
16+
traceEnd
1617

1718
uploadAssembly "${ASSEMBLY_PREFIX}" "${PROJECT_NAME}"
1819

1920
# If the RUNTIME_VERSION env variable is already set, i.e. - through the Buildkite menu
2021
# then skip reading the file.
2122
if [[ -n $"{RUNTIME_VERSION:-}" ]]; then
22-
export RUNTIME_VERSION="$(cat ../gdk-for-unity/workers/unity/Packages/io.improbable.gdk.tools/runtime.pinned)"
23+
export RUNTIME_VERSION="$(cat ../gdk-for-unity/workers/unity/Packages/io.improbable.gdk.tools/runtime.pinned)"
2324
fi
2425

25-
echo "--- Launching main deployment :airplane_departure:"
26-
27-
dotnet run -p workers/unity/Packages/io.improbable.gdk.deploymentlauncher/.DeploymentLauncher/DeploymentLauncher.csproj -- \
28-
create \
29-
--project_name "${PROJECT_NAME}" \
30-
--assembly_name "${ASSEMBLY_NAME}" \
31-
--deployment_name "${ASSEMBLY_NAME}" \
32-
--launch_json_path cloud_launch_large.json \
33-
--snapshot_path snapshots/cloud.snapshot \
34-
--region EU \
35-
--tags "dev_login" \
36-
--runtime_version="${RUNTIME_VERSION}"
26+
traceStart "Launching main deployment :airplane_departure:"
27+
dotnet run -p workers/unity/Packages/io.improbable.gdk.deploymentlauncher/.DeploymentLauncher/DeploymentLauncher.csproj -- \
28+
create \
29+
--project_name "${PROJECT_NAME}" \
30+
--assembly_name "${ASSEMBLY_NAME}" \
31+
--deployment_name "${ASSEMBLY_NAME}" \
32+
--launch_json_path cloud_launch_large.json \
33+
--snapshot_path snapshots/cloud.snapshot \
34+
--region EU \
35+
--tags "dev_login" \
36+
--runtime_version="${RUNTIME_VERSION}"
37+
traceEnd
3738

3839
CONSOLE_URL="https://console.improbable.io/projects/${PROJECT_NAME}/deployments/${ASSEMBLY_NAME}/overview"
3940

4041
buildkite-agent annotate --style "success" "Deployment URL: ${CONSOLE_URL}<br/>"
4142

42-
echo "--- Launching sim player deployment :robot_face:"
43-
44-
dotnet run -p workers/unity/Packages/io.improbable.gdk.deploymentlauncher/.DeploymentLauncher/DeploymentLauncher.csproj -- \
45-
create-sim \
46-
--project_name "${PROJECT_NAME}" \
47-
--assembly_name "${ASSEMBLY_NAME}" \
48-
--deployment_name "${ASSEMBLY_NAME}_sim_players" \
49-
--launch_json_path cloud_launch_large_sim_players.json \
50-
--region EU \
51-
--runtime_version="${RUNTIME_VERSION}" \
52-
--target_deployment "${ASSEMBLY_NAME}" \
53-
--flag_prefix fps \
54-
--simulated_coordinator_worker_type SimulatedPlayerCoordinator
43+
traceStart "Launching sim player deployment :robot_face:"
44+
dotnet run -p workers/unity/Packages/io.improbable.gdk.deploymentlauncher/.DeploymentLauncher/DeploymentLauncher.csproj -- \
45+
create-sim \
46+
--project_name "${PROJECT_NAME}" \
47+
--assembly_name "${ASSEMBLY_NAME}" \
48+
--deployment_name "${ASSEMBLY_NAME}_sim_players" \
49+
--launch_json_path cloud_launch_large_sim_players.json \
50+
--region EU \
51+
--runtime_version="${RUNTIME_VERSION}" \
52+
--target_deployment "${ASSEMBLY_NAME}" \
53+
--flag_prefix fps \
54+
--simulated_coordinator_worker_type SimulatedPlayerCoordinator
55+
traceEnd
5556

5657
CONSOLE_URL_SIM_PLAYERS="https://console.improbable.io/projects/${PROJECT_NAME}/deployments/${ASSEMBLY_NAME}_sim_players/overview"
5758

ci/lint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e -u -o pipefail
44

55
if [[ -n "${DEBUG-}" ]]; then
6-
set -x
6+
set -x
77
fi
88

99
cd "$(dirname "$0")/.."

ci/shared-ci.pinned

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
master cf777f352fe143c70b0f4cb64f438d76d9cc409a
1+
master e23a8b76403a62d8029ec4bc249e98e759592670

ci/test.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e -u -o pipefail
44

55
if [[ -n "${DEBUG-}" ]]; then
6-
set -x
6+
set -x
77
fi
88

99
cd "$(dirname "$0")/../"
@@ -17,15 +17,15 @@ mkdir -p "${PROJECT_DIR}/logs/"
1717

1818
EDITMODE_TEST_RESULTS_FILE="${PROJECT_DIR}/logs/nunit/editmode-test-results.xml"
1919

20-
echo "--- Testing Unity: Editmode :writing_hand:"
21-
22-
pushd "workers/unity"
23-
dotnet run -p "${PROJECT_DIR}/.shared-ci/tools/RunUnity/RunUnity.csproj" -- \
24-
-batchmode \
25-
-projectPath "${PROJECT_DIR}/workers/unity" \
26-
-runEditorTests \
27-
-logfile "${PROJECT_DIR}/logs/unity-editmode-test-run.log" \
28-
-editorTestsResultFile "${EDITMODE_TEST_RESULTS_FILE}" \
29-
-editorTestsFilter Fps \
30-
"${ACCELERATOR_ARGS}"
31-
popd
20+
traceStart "Testing Unity: Editmode :writing_hand:"
21+
pushd "workers/unity"
22+
dotnet run -p "${PROJECT_DIR}/.shared-ci/tools/RunUnity/RunUnity.csproj" -- \
23+
-batchmode \
24+
-projectPath "${PROJECT_DIR}/workers/unity" \
25+
-runEditorTests \
26+
-logfile "${PROJECT_DIR}/logs/unity-editmode-test-run.log" \
27+
-editorTestsResultFile "${EDITMODE_TEST_RESULTS_FILE}" \
28+
-editorTestsFilter Fps \
29+
"${ACCELERATOR_ARGS}"
30+
popd
31+
traceEnd

0 commit comments

Comments
 (0)