Skip to content

Commit 35c6d45

Browse files
committed
pr feedback
1 parent 8824ea4 commit 35c6d45

File tree

6 files changed

+340
-51
lines changed

6 files changed

+340
-51
lines changed

.github/workflows/cloud-runner-integrity.yml

Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,230 @@ jobs:
728728
AWS_ENDPOINT_URL: http://localhost:4566
729729
GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
730730
GITHUB_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
731+
localDocker:
732+
name: Cloud Runner Tests (Local Docker with LocalStack S3)
733+
runs-on: ubuntu-latest
734+
steps:
735+
- uses: actions/checkout@v4
736+
with:
737+
lfs: false
738+
- uses: actions/setup-node@v4
739+
with:
740+
node-version: 20
741+
cache: 'yarn'
742+
- name: Clean up disk space before tests
743+
run: |
744+
# Clean up any leftover cache files from previous runs
745+
rm -rf ./cloud-runner-cache/* || true
746+
# Clean up system caches and temporary files
747+
sudo apt-get clean || true
748+
docker system prune -f || true
749+
# Show available disk space
750+
df -h
751+
- name: Start LocalStack (S3)
752+
uses: localstack/[email protected]
753+
with:
754+
install-awslocal: true
755+
- name: Verify LocalStack is running
756+
run: |
757+
echo "Checking LocalStack status..."
758+
curl -s http://localhost:4566/_localstack/health | head -10 || echo "LocalStack health check failed"
759+
# Check if LocalStack container is running
760+
docker ps | grep localstack || echo "No LocalStack container found"
761+
- name: Create S3 bucket for tests
762+
run: |
763+
awslocal s3 mb s3://$AWS_STACK_NAME || true
764+
awslocal s3 ls
765+
- run: yarn install --frozen-lockfile
766+
- name: Clean up disk space
767+
run: |
768+
rm -rf ./cloud-runner-cache/* || true
769+
docker system prune -f || true
770+
df -h
771+
- name: Run cloud-runner-image test
772+
timeout-minutes: 10
773+
run: yarn run test "cloud-runner-image" --detectOpenHandles --forceExit --runInBand
774+
env:
775+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
776+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
777+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
778+
PROJECT_PATH: test-project
779+
TARGET_PLATFORM: StandaloneWindows64
780+
cloudRunnerTests: true
781+
versioning: None
782+
PROVIDER_STRATEGY: local-docker
783+
GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
784+
GITHUB_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
785+
- name: Clean up disk space
786+
run: |
787+
rm -rf ./cloud-runner-cache/* || true
788+
docker system prune -f || true
789+
df -h
790+
- name: Run cloud-runner-hooks test
791+
timeout-minutes: 30
792+
run: yarn run test "cloud-runner-hooks" --detectOpenHandles --forceExit --runInBand
793+
env:
794+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
795+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
796+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
797+
PROJECT_PATH: test-project
798+
TARGET_PLATFORM: StandaloneWindows64
799+
cloudRunnerTests: true
800+
versioning: None
801+
PROVIDER_STRATEGY: local-docker
802+
GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
803+
GITHUB_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
804+
- name: Clean up disk space
805+
run: |
806+
rm -rf ./cloud-runner-cache/* || true
807+
docker system prune -f || true
808+
df -h
809+
- name: Run cloud-runner-local-persistence test
810+
timeout-minutes: 30
811+
run: yarn run test "cloud-runner-local-persistence" --detectOpenHandles --forceExit --runInBand
812+
env:
813+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
814+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
815+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
816+
PROJECT_PATH: test-project
817+
TARGET_PLATFORM: StandaloneWindows64
818+
cloudRunnerTests: true
819+
versioning: None
820+
PROVIDER_STRATEGY: local-docker
821+
GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
822+
GITHUB_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
823+
- name: Clean up disk space
824+
run: |
825+
rm -rf ./cloud-runner-cache/* || true
826+
docker system prune -f || true
827+
df -h
828+
- name: Run cloud-runner-locking-core test
829+
timeout-minutes: 30
830+
run: yarn run test "cloud-runner-locking-core" --detectOpenHandles --forceExit --runInBand
831+
env:
832+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
833+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
834+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
835+
PROJECT_PATH: test-project
836+
TARGET_PLATFORM: StandaloneWindows64
837+
cloudRunnerTests: true
838+
versioning: None
839+
PROVIDER_STRATEGY: local-docker
840+
GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
841+
GITHUB_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
842+
- name: Clean up disk space
843+
run: |
844+
rm -rf ./cloud-runner-cache/* || true
845+
docker system prune -f || true
846+
df -h
847+
- name: Run cloud-runner-locking-get-locked test
848+
timeout-minutes: 30
849+
run: yarn run test "cloud-runner-locking-get-locked" --detectOpenHandles --forceExit --runInBand
850+
env:
851+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
852+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
853+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
854+
PROJECT_PATH: test-project
855+
TARGET_PLATFORM: StandaloneWindows64
856+
cloudRunnerTests: true
857+
versioning: None
858+
PROVIDER_STRATEGY: local-docker
859+
GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
860+
GITHUB_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
861+
- name: Clean up disk space
862+
run: |
863+
rm -rf ./cloud-runner-cache/* || true
864+
docker system prune -f || true
865+
df -h
866+
- name: Run cloud-runner-caching test
867+
timeout-minutes: 30
868+
run: yarn run test "cloud-runner-caching" --detectOpenHandles --forceExit --runInBand
869+
env:
870+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
871+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
872+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
873+
PROJECT_PATH: test-project
874+
TARGET_PLATFORM: StandaloneWindows64
875+
cloudRunnerTests: true
876+
versioning: None
877+
PROVIDER_STRATEGY: local-docker
878+
GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
879+
GITHUB_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
880+
- name: Clean up disk space
881+
run: |
882+
rm -rf ./cloud-runner-cache/* || true
883+
docker system prune -f || true
884+
df -h
885+
- name: Run cloud-runner-github-checks test
886+
timeout-minutes: 30
887+
run: yarn run test "cloud-runner-github-checks" --detectOpenHandles --forceExit --runInBand
888+
env:
889+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
890+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
891+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
892+
PROJECT_PATH: test-project
893+
TARGET_PLATFORM: StandaloneWindows64
894+
cloudRunnerTests: true
895+
versioning: None
896+
PROVIDER_STRATEGY: local-docker
897+
GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
898+
GITHUB_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
899+
- name: Clean up disk space
900+
run: |
901+
rm -rf ./cloud-runner-cache/* || true
902+
docker system prune -f || true
903+
df -h
904+
- name: Run cloud-runner-s3-steps test (LocalStack S3 with local-docker)
905+
timeout-minutes: 30
906+
run: yarn run test "cloud-runner-s3-steps" --detectOpenHandles --forceExit --runInBand
907+
env:
908+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
909+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
910+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
911+
PROJECT_PATH: test-project
912+
TARGET_PLATFORM: StandaloneWindows64
913+
cloudRunnerTests: true
914+
versioning: None
915+
PROVIDER_STRATEGY: local-docker
916+
AWS_STACK_NAME: game-ci-team-pipelines
917+
AWS_ACCESS_KEY_ID: test
918+
AWS_SECRET_ACCESS_KEY: test
919+
AWS_S3_ENDPOINT: http://localhost:4566
920+
AWS_ENDPOINT: http://localhost:4566
921+
INPUT_AWSS3ENDPOINT: http://localhost:4566
922+
INPUT_AWSENDPOINT: http://localhost:4566
923+
AWS_S3_FORCE_PATH_STYLE: 'true'
924+
AWS_EC2_METADATA_DISABLED: 'true'
925+
GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
926+
GITHUB_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
927+
- name: Clean up disk space
928+
run: |
929+
rm -rf ./cloud-runner-cache/* || true
930+
docker system prune -f || true
931+
df -h
932+
- name: Run cloud-runner-end2end-caching test (LocalStack S3 with local-docker)
933+
timeout-minutes: 60
934+
run: yarn run test "cloud-runner-end2end-caching" --detectOpenHandles --forceExit --runInBand
935+
env:
936+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
937+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
938+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
939+
PROJECT_PATH: test-project
940+
TARGET_PLATFORM: StandaloneWindows64
941+
cloudRunnerTests: true
942+
versioning: None
943+
PROVIDER_STRATEGY: local-docker
944+
AWS_STACK_NAME: game-ci-team-pipelines
945+
AWS_ACCESS_KEY_ID: test
946+
AWS_SECRET_ACCESS_KEY: test
947+
AWS_S3_ENDPOINT: http://localhost:4566
948+
AWS_ENDPOINT: http://localhost:4566
949+
INPUT_AWSS3ENDPOINT: http://localhost:4566
950+
INPUT_AWSENDPOINT: http://localhost:4566
951+
AWS_S3_FORCE_PATH_STYLE: 'true'
952+
AWS_EC2_METADATA_DISABLED: 'true'
953+
GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
954+
GITHUB_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
731955
# Commented out: Using LocalStack tests instead of real AWS
732956
# aws:
733957
# name: Cloud Runner Tests (AWS)

dist/index.js

Lines changed: 54 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/model/cloud-runner/providers/k8s/kubernetes-task-runner.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ class KubernetesTaskRunner {
2929
`Streaming logs from pod: ${podName} container: ${containerName} namespace: ${namespace} ${CloudRunner.buildParameters.kubeVolumeSize}/${CloudRunner.buildParameters.containerCpu}/${CloudRunner.buildParameters.containerMemory}`,
3030
);
3131
const isRunning = await KubernetesPods.IsPodRunning(podName, namespace, kubeClient);
32-
let extraFlags = ``;
33-
extraFlags += isRunning ? ` -f -c ${containerName} -n ${namespace}` : ` --previous -n ${namespace}`;
3432

3533
const callback = (outputChunk: string) => {
3634
output += outputChunk;
@@ -46,7 +44,14 @@ class KubernetesTaskRunner {
4644
}
4745
};
4846
try {
49-
await CloudRunnerSystem.Run(`kubectl logs ${podName}${extraFlags}`, false, true, callback);
47+
// Always specify container name explicitly to avoid containerd:// errors
48+
// Use -f for running pods, --previous for terminated pods
49+
await CloudRunnerSystem.Run(
50+
`kubectl logs ${podName} -c ${containerName} -n ${namespace}${isRunning ? ' -f' : ' --previous'}`,
51+
false,
52+
true,
53+
callback,
54+
);
5055
} catch (error: any) {
5156
await new Promise((resolve) => setTimeout(resolve, 3000));
5257
const continueStreaming = await KubernetesPods.IsPodRunning(podName, namespace, kubeClient);

0 commit comments

Comments
 (0)