diff --git a/.github/workflows/cf-containers.yml b/.github/workflows/cf-containers.yml new file mode 100644 index 00000000..3da82b43 --- /dev/null +++ b/.github/workflows/cf-containers.yml @@ -0,0 +1,51 @@ +name: Cloud Framework Containers + +on: workflow_dispatch + +jobs: + pubsub-container: + name: "Build Pub/Sub Container" + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Build Container + run: | + cd build + docker build . -f UET/Lib/Container/pubsub.Dockerfile --tag ghcr.io/redpointgames/uet/pubsub-emulator:latest + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + if: github.ref == 'refs/heads/main' + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Push Container + if: github.ref == 'refs/heads/main' + run: | + docker push ghcr.io/redpointgames/uet/pubsub-emulator:latest + datastore-container: + name: "Build Datastore Container" + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Build Container + run: | + cd build + docker build . -f UET/Lib/Container/datastore.Dockerfile --tag ghcr.io/redpointgames/uet/datastore-emulator:latest + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + if: github.ref == 'refs/heads/main' + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Push Container + if: github.ref == 'refs/heads/main' + run: | + docker push ghcr.io/redpointgames/uet/datastore-emulator:latest \ No newline at end of file diff --git a/UET/Lib/Container/datastore.Dockerfile b/UET/Lib/Container/datastore.Dockerfile new file mode 100644 index 00000000..71fb1e30 --- /dev/null +++ b/UET/Lib/Container/datastore.Dockerfile @@ -0,0 +1,12 @@ +FROM gcr.io/google.com/cloudsdktool/cloud-sdk:latest + +EXPOSE 9001 +ENV CLOUDSDK_CORE_PROJECT local-dev + +# DO NOT UNDER ANY CIRCUMSTANCES ADD THE --use-firestore-in-datastore-mode FLAG +# +# This flag does not properly emulate "Firestore in Datastore mode" and *actively* breaks +# transaction integrity in the emulator, leading to transaction commits going through +# when they should fail with contention errors. +# +ENTRYPOINT [ "gcloud", "beta", "emulators", "datastore", "start", "--host-port=0.0.0.0:9001", "--no-store-on-disk", "--consistency=1.0" ] \ No newline at end of file diff --git a/UET/Lib/Container/pubsub.Dockerfile b/UET/Lib/Container/pubsub.Dockerfile new file mode 100644 index 00000000..78dc0d6e --- /dev/null +++ b/UET/Lib/Container/pubsub.Dockerfile @@ -0,0 +1,6 @@ +FROM gcr.io/google.com/cloudsdktool/cloud-sdk:latest + +EXPOSE 9000 +ENV CLOUDSDK_CORE_PROJECT local-dev + +ENTRYPOINT [ "gcloud", "beta", "emulators", "pubsub", "start", "--host-port=0.0.0.0:9000" ] \ No newline at end of file