one beautiful commit for docker

This commit is contained in:
Loup-Garou911XD 2024-06-06 21:41:03 +05:30
parent 8ce9b77c4f
commit ca710b04bc
23 changed files with 539 additions and 183 deletions

100
.efrocachemap generated
View File

@ -421,9 +421,9 @@
"build/assets/ba_data/audio/zoeOw.ogg": "74befe45a8417e95b6a2233c51992a26",
"build/assets/ba_data/audio/zoePickup01.ogg": "48ab8cddfcde36a750856f3f81dd20c8",
"build/assets/ba_data/audio/zoeScream01.ogg": "2b468aedfa8741090247f04eb9e6df55",
"build/assets/ba_data/data/langdata.json": "faffc0854bc4c34f4ef427404ec75c4d",
"build/assets/ba_data/data/languages/arabic.json": "5c27239be3d4f8daefd9f3bd7e99ff8d",
"build/assets/ba_data/data/languages/belarussian.json": "260d190aae3282a726b4a27019972d58",
"build/assets/ba_data/data/langdata.json": "7e73466677344c1722aebe94003360d5",
"build/assets/ba_data/data/languages/arabic.json": "05040616cb7585e3cce2e9acba96aa75",
"build/assets/ba_data/data/languages/belarussian.json": "3d5523d0004293aa2df02f3f6f3b84f8",
"build/assets/ba_data/data/languages/chinese.json": "2f67c6b127ae85492ac552af1a91e95a",
"build/assets/ba_data/data/languages/chinesetraditional.json": "319565f8a15667488f48dbce59278e39",
"build/assets/ba_data/data/languages/croatian.json": "e671b9d0c012be1a30f9c15eb1b81860",
@ -432,7 +432,7 @@
"build/assets/ba_data/data/languages/dutch.json": "b0900d572c9141897d53d6574c471343",
"build/assets/ba_data/data/languages/english.json": "9754e816d3bc3214b7e809950d642309",
"build/assets/ba_data/data/languages/esperanto.json": "0e397cfa5f3fb8cef5f4a64f21cda880",
"build/assets/ba_data/data/languages/filipino.json": "920fc429ec9b587edc2c6294fffada71",
"build/assets/ba_data/data/languages/filipino.json": "9c04219ceeb065b3bc751e6ab3731def",
"build/assets/ba_data/data/languages/french.json": "ee2a81129519d7030a617308da8c9195",
"build/assets/ba_data/data/languages/german.json": "198b9860c5b9df7b8e3e30b03d8755cb",
"build/assets/ba_data/data/languages/gibberish.json": "3e68d809bd6ede3b9e2c57c147737e42",
@ -443,8 +443,8 @@
"build/assets/ba_data/data/languages/italian.json": "e1d69eb1eec31442bf981121c7cfaf17",
"build/assets/ba_data/data/languages/korean.json": "4e3524327a0174250aff5e1ef4c0c597",
"build/assets/ba_data/data/languages/malay.json": "f6ce0426d03a62612e3e436ed5d1be1f",
"build/assets/ba_data/data/languages/persian.json": "8bd6251e46c8ca7fcd075d989e79f0d9",
"build/assets/ba_data/data/languages/polish.json": "82ad9f88c7d0499a049d2008c85aa6f1",
"build/assets/ba_data/data/languages/persian.json": "c209f8f6d3b3dd40d5ca9d36fe0721fe",
"build/assets/ba_data/data/languages/polish.json": "59ff98adfb4f515f00769d1ec229c232",
"build/assets/ba_data/data/languages/portuguese.json": "615a59bd03f84659158d9f2608a4ab21",
"build/assets/ba_data/data/languages/romanian.json": "b3e46efd6f869dbd78014570e037c290",
"build/assets/ba_data/data/languages/russian.json": "41e06eda170fb5960393dd6b58d046e1",
@ -4038,50 +4038,50 @@
"build/assets/windows/Win32/ucrtbased.dll": "2def5335207d41b21b9823f6805997f1",
"build/assets/windows/Win32/vc_redist.x86.exe": "b08a55e2e77623fe657bea24f223a3ae",
"build/assets/windows/Win32/vcruntime140d.dll": "865b2af4d1e26a1a8073c89acb06e599",
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "9ac7439035bfc6e58c09fd333be7bf32",
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "0a6c29a617a2a7f75b5ea74ae31c00ba",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "090c580f73c18253ad03fa7bdb5410c6",
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "fb8aa86a244b28b683ea8148f63800e2",
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "a6fb7f0164a400a8bce7c7cb2327f41b",
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "c6e86f716993e4db6d40b387c1887bf9",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "fdb8c01b631d5475740f0101b301ff03",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "8c58b1dff5c711bf8dfe6bcc0c033e02",
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "68b0c339ca50a9d498f044d1b9c25665",
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "4bd338604cf6288636422ef3b62e5d44",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "d585e0b8f0a2a1edefd52b9d9fb2fd40",
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "316e826a593499760060c1c2c09fe278",
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "7070657c31c247dac4d1b14607a8435f",
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "606f7ed5a63fad5acbdba62b8f2e953f",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "ccfa7d16a67a8b5e28b832861433b536",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "f98f149307ee2096aa5c82fb666d96b2",
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "b3d826dae3e8105e5507a50d53142b56",
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "ffc3963828ad90d6da6237aa374909b9",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "21b69244af53ac854f513dbe574e9281",
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "92edda56e8cc74c3552f87d766a83a8c",
"build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "9162b53189b80d4e5938cd142acd2a1a",
"build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "2226d0e2d34051d962320c86464f3a2d",
"build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "9162b53189b80d4e5938cd142acd2a1a",
"build/prefab/lib/linux_arm64_server/release/libballisticaplus.a": "2226d0e2d34051d962320c86464f3a2d",
"build/prefab/lib/linux_x86_64_gui/debug/libballisticaplus.a": "c2d287b53bdac7e5302fe833ac052d2c",
"build/prefab/lib/linux_x86_64_gui/release/libballisticaplus.a": "b3942d4e7c940d86fc039ae149756d3f",
"build/prefab/lib/linux_x86_64_server/debug/libballisticaplus.a": "c2d287b53bdac7e5302fe833ac052d2c",
"build/prefab/lib/linux_x86_64_server/release/libballisticaplus.a": "b3942d4e7c940d86fc039ae149756d3f",
"build/prefab/lib/mac_arm64_gui/debug/libballisticaplus.a": "6c3d9a42b9cdc7af45f7273f76010dd5",
"build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "404e2e994a58d2e930f189ab835ada45",
"build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "6c3d9a42b9cdc7af45f7273f76010dd5",
"build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "404e2e994a58d2e930f189ab835ada45",
"build/prefab/lib/mac_x86_64_gui/debug/libballisticaplus.a": "848cfd50cf15726e3acefd60204a85c5",
"build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "299b6c4b83966040618b27563b700c2a",
"build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "08c2f91d086e6f3fa73ebc299112358a",
"build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "299b6c4b83966040618b27563b700c2a",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "50245294e53c993dd3a25db2868f22e0",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "84d98c5f0dbab599afd67a0fcf8e28d8",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "08f5b3b61056a65d7f39009426d08c48",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "3e4073e334438027320f3fcc2268357f",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "51ac5f179b08a8892580ba915452b40a",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "a61545d3d93c89c5298536c133745c5d",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "1a0c96f28a75527e975af1c023716f0f",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "0725628caf7f5baa9a59d1022f62a441",
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "0c51eee4af632ca8e9132edfea6c5ef5",
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "d086ea46307e571d6278a1ac00e7199f",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "4119ef59158a5572098c997a01988d42",
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "6f59df95b4c858986852123b779ea70c",
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "62505635f81cb7ed9804ec5b0eb43c5a",
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "8e493b1b5c987401daa7cda81e7faeb9",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "bb97152641a4ce2c41722ef4da314086",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "843f0dfcd9bdc2b6886cdd1ac6ba0fc2",
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "76fff737c7e5e513aa0c55d6dbe179a4",
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "4e81fe4c953d35f96c81ec19f93525d3",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "33d430a5730d2c226765a11f86dd0599",
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "6cd4a729aacbb3838ea020bdfc7d67d2",
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "2b5f1112f0328d69f3863fb2e06a730d",
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "b051c7642dfcf446dcd1657c121eac21",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "dc8e5d62bcfc1a645c028a7df7ecb738",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "4548c17cdfe8998aa8ecb31ad973ae74",
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "333d8035d9233fee2e2b09c158c720e6",
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "3f4453380fd5d175c8fb18d8ca3ece4f",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "8d19f198e01491a98bede19987b8cc8f",
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "2270da9585ffdca2c0eab77196c3f7d4",
"build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "bb11ac758712a51791340d19121b9791",
"build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "c47ac1d2e839e4e3b701a7c59080dd09",
"build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "bb11ac758712a51791340d19121b9791",
"build/prefab/lib/linux_arm64_server/release/libballisticaplus.a": "c47ac1d2e839e4e3b701a7c59080dd09",
"build/prefab/lib/linux_x86_64_gui/debug/libballisticaplus.a": "9cb1b5b345dd00b58992913677a4ad7e",
"build/prefab/lib/linux_x86_64_gui/release/libballisticaplus.a": "8a961e945aeb0120d924ec06a162fb55",
"build/prefab/lib/linux_x86_64_server/debug/libballisticaplus.a": "9cb1b5b345dd00b58992913677a4ad7e",
"build/prefab/lib/linux_x86_64_server/release/libballisticaplus.a": "8a961e945aeb0120d924ec06a162fb55",
"build/prefab/lib/mac_arm64_gui/debug/libballisticaplus.a": "5fcc0e89141d36e5b152095bfcc21fa1",
"build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "1b63b3daeff198825740a426fe5f7a9f",
"build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "5fcc0e89141d36e5b152095bfcc21fa1",
"build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "1b63b3daeff198825740a426fe5f7a9f",
"build/prefab/lib/mac_x86_64_gui/debug/libballisticaplus.a": "e86e8adff4bf043e2c3796ed499ca134",
"build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "2fddab497b60617bcaa467a458e5534c",
"build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "b21ff6427895bcd8628ea55a3c2d8609",
"build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "2fddab497b60617bcaa467a458e5534c",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "4594d3bdd6f0d5103da725b67c442ca5",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "37f0e4fef1e9106835c572a12f8a0354",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "660139dfa55cdbc071bf43526504823b",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "a1961b9730c58599ef326b6af9da7f93",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "f534609cbfc3b2743a07c0aafb380f4b",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "fd05e46d0f3acbf9dfa6a6d3b7f75926",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "db3a41fe7b3b22c90229b3ecdeb2e5ec",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "9b21b94333a5f61d45c40bcb94a53a53",
"src/assets/ba_data/python/babase/_mgen/__init__.py": "f885fed7f2ed98ff2ba271f9dbe3391c",
"src/assets/ba_data/python/babase/_mgen/enums.py": "5548f407d97e380069f6c596c4e36cd7",
"src/ballistica/base/mgen/pyembed/binding_base.inc": "efa61468cf098f77cc6a234461d8b86d",

View File

@ -5,7 +5,7 @@ on:
- cron: '30 5 * * *'
jobs:
make_docker_image:
make_docker_gui_debug_image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@ -16,13 +16,35 @@ jobs:
- name: Setup project environment
run: make env
- name: Make the build
run: make docker-save
run: |
make docker-gui-debug
make docker-save
- name: Upload the build
uses: actions/upload-artifact@v4
with:
name: docker_server(release)
path: build/docker/bombsquad_server_docker.tar
name: docker_gui(debug)
path: build/docker/bombsquad_gui_debug_docker.tar
make_docker_server_debug_image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Setup project environment
run: make env
- name: Make the build
run: |
make docker-server-debug
make docker-save
- name: Upload the build
uses: actions/upload-artifact@v4
with:
name: docker_server(debug)
path: build/docker/bombsquad_server_debug_docker.tar
make_sphinx_docs:
runs-on: ubuntu-latest
steps:

View File

@ -208,7 +208,7 @@ jobs:
allowUpdates: true
artifacts: windows_x86_server_debug.tar
release_docker_image:
release_docker_gui_image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@ -219,12 +219,38 @@ jobs:
- name: Setup project environment
run: make env
- name: Make the build
run: make docker-save
run: |
make docker-gui-release
make docker-save
- name: Rename the build
run: mv build/docker/bombsquad_gui_release_docker.tar build/docker/bombsquad_docker_gui.tar
- name: Upload the build
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: build/docker/bombsquad_server_docker.tar
artifacts: build/docker/bombsquad_docker_gui.tar
release_docker_server_image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Setup project environment
run: make env
- name: Make the build
run: |
make docker-server-release
make docker-save
- name: Rename the build
run: mv build/docker/bombsquad_server_release_docker.tar build/docker/bombsquad_docker_server.tar
- name: Upload the build
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: build/docker/bombsquad_docker_server.tar
release_sphinx_docs:
runs-on: ubuntu-latest

View File

@ -1,4 +1,4 @@
### 1.7.35 (build 21880, api 8, 2024-05-19)
### 1.7.35 (build 21884, api 8, 2024-06-12)
- Fixed an issue where the engine would block at exit on some version of Linux
until Ctrl-D was pressed in the calling terminal.
- V2 accounts have been around for a while now, so the old V1 device login

View File

@ -1183,23 +1183,35 @@ clion-staging: assets-cmake resources meta
# #
################################################################################
# Build the docker image named bombsquad_server
docker-build: assets-cmake
$(PCOMMAND) build_docker
# Build the docker image
docker-gui-release: assets-cmake
$(PCOMMAND) build_docker_gui_release
# Run the bombsquad_server image
docker-run:
docker run -it bombsquad_server
# Build the docker image
docker-gui-debug: assets-cmake
$(PCOMMAND) build_docker_gui_debug
# Build the docker image
docker-server-release: assets-cmake
$(PCOMMAND) build_docker_server_release,
# Build the docker image
docker-server-debug: assets-cmake
$(PCOMMAND) build_docker_server_debug
# Build the docker image for arm64
docker-arm64-gui-release: assets-cmake
$(PCOMMAND) build_docker_arm64
# Save the bombsquad_server docker image to build/docker/bombsquad_server_docker.tar
docker-save: docker-build
docker-save:
mkdir -p build/docker/
docker save bombsquad_server -o build/docker/bombsquad_server_docker.tar
$(PCOMMAND) save_docker_images
# Cleanup docker files
docker-clean:
rm build/docker/bombsquad_server_docker.tar
docker rmi bombsquad_server --force
rm -rf build/docker/
$(PCOMMAND) remove_docker_images
docker system prune

View File

@ -1,21 +1,24 @@
# if provided it will make debug build
ARG cmake_build_type=Release
# system to start with the build with
# currently will break for non ubuntu system
ARG base_image=ubuntu:24.04
# whether to make GUI or headless build (defaults to headless)
ARG headless_build=1
# system to start with the build with
# currently will break for other images
ARG base_image=ubuntu:latest
#-------------------------------BUILDER--------------------------------
# Start with the base image
FROM ${base_image} AS builder
# Renew the arg
ARG headless_build
ARG cmake_build_type
ENV LANG en_US.utf8
ENV LANGUAGE=en_US
ENV DEBIAN_FRONTEND=noninteractive
ENV CMAKE_BUILD_TYPE=${cmake_build_type}
ENV HEADLESS_BUILD=${headless_build}
# Install build dependencies
RUN apt-get update -y && \
@ -24,25 +27,31 @@ RUN apt-get update -y && \
python3.12-venv \
python3-pip \
libsdl2-dev \
libvorbisfile3 \
freeglut3-dev \
libglut-dev \
libopenal-dev \
libvorbis-dev \
make \
curl \
rsync \
clang-format \
cmake \
libvorbis-dev
cmake
# Copy source code
COPY ./ /home/ubuntu/ballistica
COPY ./ /ballistica
WORKDIR /home/ubuntu/ballistica
WORKDIR /ballistica
# Compile the application
RUN make cmake-server-build \
&& mkdir ./../ballistica_cmake_server \
&& mv build/cmake/* ./../ballistica_cmake_server
RUN mkdir /ballistica_cmake && \
if [ "$HEADLESS_BUILD" != "0" ]; then \
make cmake-server-build && \
mv build/cmake/*/ballisticakit_headless build/cmake/*/staged/dist; \
else \
make cmake-build && \
mv build/cmake/*/ballisticakit build/cmake/*/staged/; \
fi && \
mv build/cmake/*/staged/* /ballistica_cmake
#-------------------------------RUNNER--------------------------------
# Create a new stage for the runtime environment
@ -53,33 +62,36 @@ ENV LANGUAGE=en_US
ENV DEBIAN_FRONTEND=noninteractive
# Renew the arg
ARG headless_build
ENV HEADLESS_BUILD=${headless_build}
ARG cmake_build_type
LABEL BUILD_TYPE=${cmake_build_type}
ARG bombsquad_build=N/A
LABEL BOMBSQUAD_BUILD=${bombsquad_build}
ARG bombsquad_version=N/A
LABEL BOMBSQUAD_VERSION=${bombsquad_version}
LABEL BOMBSQUAD_BUILD_TYPE=${cmake_build_type}
# Install runtime dependencies
RUN apt-get update -y && \
apt-get install -y \
python3.12-dev \
&& rm -rf /var/lib/apt/lists/* \
&& python3.12 -c "import uuid;print(uuid.uuid4())">/etc/machine-id
python3.12-dev && \
if [ "$HEADLESS_BUILD" = "0" ]; then \
apt-get install -y \
libsdl2-dev \
libvorbis-dev \
libglut-dev \
libopenal-dev; \
fi && \
rm -rf /var/lib/apt/lists/* && \
dbus-uuidgen > /etc/machine-id
# Copy the compiled application from the builder stage
COPY --from=builder /home/ubuntu/ballistica_cmake_server/*/staged \
COPY --from=builder /ballistica_cmake \
/home/ubuntu/ballistica
# ballisticakit_headless in staged is a symlink
COPY --from=builder /home/ubuntu/ballistica_cmake_server/*/ballisticakit_headless \
/home/ubuntu/ballistica/dist
WORKDIR /home/ubuntu/ballistica
RUN ln -s ballisticakit* run
# Expose the necessary port
EXPOSE 43210/udp
EXPOSE 43210/udp
# Set the default command to run the application
CMD [ "./ballisticakit_server" ]
CMD [ "./run" ]

View File

@ -6,16 +6,16 @@ mypy==1.10.0
pbxproj==4.1.0
pdoc==14.5.0
pur==7.3.1
pylint==3.2.1
pylint==3.2.2
pylsp-mypy==0.6.8
pytest==8.2.0
pytest==8.2.1
python-daemon==3.0.1
python-lsp-black==2.0.0
python-lsp-server==1.11.0
requests==2.31.0
requests==2.32.3
Sphinx==7.3.7
tomlkit==0.12.5
types-certifi==2021.10.8.3
types-filelock==3.2.7
types-requests==2.31.0.20240406
typing_extensions==4.11.0
types-requests==2.32.0.20240523
typing_extensions==4.12.0

View File

@ -116,6 +116,10 @@
"ba_data/python/bacommon/net.py",
"ba_data/python/bacommon/servermanager.py",
"ba_data/python/bacommon/transfer.py",
"ba_data/python/bacommon/workspace/__init__.py",
"ba_data/python/bacommon/workspace/__pycache__/__init__.cpython-312.opt-1.pyc",
"ba_data/python/bacommon/workspace/__pycache__/assetsv1.cpython-312.opt-1.pyc",
"ba_data/python/bacommon/workspace/assetsv1.py",
"ba_data/python/baenv.py",
"ba_data/python/baplus/__init__.py",
"ba_data/python/baplus/__pycache__/__init__.cpython-312.opt-1.pyc",

View File

@ -733,6 +733,8 @@ SCRIPT_TARGETS_PY_PUBLIC_TOOLS = \
$(BUILD_DIR)/ba_data/python/bacommon/net.py \
$(BUILD_DIR)/ba_data/python/bacommon/servermanager.py \
$(BUILD_DIR)/ba_data/python/bacommon/transfer.py \
$(BUILD_DIR)/ba_data/python/bacommon/workspace/__init__.py \
$(BUILD_DIR)/ba_data/python/bacommon/workspace/assetsv1.py \
$(BUILD_DIR)/ba_data/python/efro/__init__.py \
$(BUILD_DIR)/ba_data/python/efro/call.py \
$(BUILD_DIR)/ba_data/python/efro/cloudshell.py \
@ -768,6 +770,8 @@ SCRIPT_TARGETS_PYC_PUBLIC_TOOLS = \
$(BUILD_DIR)/ba_data/python/bacommon/__pycache__/net.cpython-312.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/bacommon/__pycache__/servermanager.cpython-312.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/bacommon/__pycache__/transfer.cpython-312.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/bacommon/workspace/__pycache__/__init__.cpython-312.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/bacommon/workspace/__pycache__/assetsv1.cpython-312.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/efro/__pycache__/__init__.cpython-312.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/efro/__pycache__/call.cpython-312.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/efro/__pycache__/cloudshell.cpython-312.opt-1.pyc \

View File

@ -52,7 +52,7 @@ if TYPE_CHECKING:
# Build number and version of the ballistica binary we expect to be
# using.
TARGET_BALLISTICA_BUILD = 21880
TARGET_BALLISTICA_BUILD = 21884
TARGET_BALLISTICA_VERSION = '1.7.35'

View File

@ -64,8 +64,8 @@ auto BasePlatform::GetPublicDeviceUUID() -> std::string {
// We used to plug version in directly here, but that caused uuids to
// shuffle too rapidly during periods of rapid development. This
// keeps it more constant.
// __last_rand_uuid_component_shuffle_date__ 2023 12 13
auto rand_uuid_component{"7YM96RZHN6ZCPZGTQONULZO1JU5NMMC7"};
// __last_rand_uuid_component_shuffle_date__ 2024 6 12
auto rand_uuid_component{"WI5XDVM7QQBD4G6O0GS2DW6IPJ4VQT9X"};
inputs.emplace_back(rand_uuid_component);
auto gil{Python::ScopedInterpreterLock()};

View File

@ -39,7 +39,7 @@ auto main(int argc, char** argv) -> int {
namespace ballistica {
// These are set automatically via script; don't modify them here.
const int kEngineBuildNumber = 21880;
const int kEngineBuildNumber = 21884;
const char* kEngineVersion = "1.7.35";
const int kEngineApiVersion = 8;

View File

@ -0,0 +1,3 @@
# Released under the MIT License. See LICENSE for details.
#
"""Workspace functionality."""

View File

@ -0,0 +1,34 @@
# Released under the MIT License. See LICENSE for details.
#
"""Defines workspace behavior."""
from __future__ import annotations
from dataclasses import dataclass
from typing import TYPE_CHECKING, Annotated
from efro.dataclassio import ioprepped, IOAttrs
if TYPE_CHECKING:
pass
@ioprepped
@dataclass
class AssetsV1GlobalVals:
"""Global values for an assets_v1 workspace."""
# Just dummy testing values for now.
emit: Annotated[bool, IOAttrs('emit')]
aggro: Annotated[float, IOAttrs('aggro')]
@ioprepped
@dataclass
class AssetsV1PathVals:
"""Path-specific values for an assets_v1 workspace path."""
# Just dummy testing values for now.
width: Annotated[int, IOAttrs('width')]
height: Annotated[int, IOAttrs('height')]

View File

@ -644,59 +644,3 @@ def cmake_prep_dir(dirname: str, verbose: bool = False) -> None:
else:
if verbose:
print(f'{Clr.BLD}{title}:{Clr.RST} Keeping existing build dir.')
def _docker_build(
image_name: str,
dockerfile_dir: str,
bombsquad_version: str | None = None,
bombsquad_build: str | int | None = None,
cmake_build_type: str | None = None,
) -> None:
build_cmd = [
'docker',
'image',
'build',
'-t',
image_name,
'-f',
dockerfile_dir,
'.',
]
if bombsquad_version is not None:
build_cmd = build_cmd + [
'--build-arg',
f'bombsquad_version={bombsquad_version}',
]
if bombsquad_build is not None:
build_cmd = build_cmd + [
'--build-arg',
f'bombsquad_build={str(bombsquad_build)}',
]
if cmake_build_type is not None:
build_cmd = build_cmd + [
'--build-arg',
f'cmake_build_type={cmake_build_type}',
]
subprocess.run(build_cmd, check=True)
def docker_build() -> None:
"""Build docker image."""
# todo: add option to toggle between prefab and cmake
from batools import version
version_num, build_num = version.get_current_version()
image_name = 'bombsquad_server'
print(
f'Building docker image {image_name}'
+ 'version {version_num}:{build_num}'
)
_docker_build(
image_name,
'config/docker/Dockerfile',
version_num,
build_num,
)

173
tools/batools/docker.py Normal file
View File

@ -0,0 +1,173 @@
# Released under the MIT License. See LICENSE for details.
#
"""General functionality related to docker builds."""
import subprocess
def _docker_build(
image_name: str,
dockerfile_dir: str,
cmake_build_type: str | None = None,
labels: dict[str, str] | None = None,
platform: str | None = None,
headless_build: bool | str | None = None,
) -> None:
build_cmd = [
'docker',
'buildx',
'build',
'--tag',
image_name,
'--file',
dockerfile_dir,
'--load',
'.',
]
if cmake_build_type is not None:
build_cmd = build_cmd + [
'--build-arg',
f'cmake_build_type={cmake_build_type}',
]
if headless_build is not None:
if headless_build:
headless_build = '1'
else:
headless_build = '0'
build_cmd = build_cmd + [
'--build-arg',
f'headless_build={headless_build}',
]
if platform is not None:
build_cmd = build_cmd + [
'--platform',
platform,
]
if labels is not None:
build_cmd = build_cmd + [
f'--label={i}={labels[i]}' for i in labels.keys()
]
subprocess.run(build_cmd, check=True)
def docker_build(
platform: str | None = 'linux/amd64',
headless_build: bool | str | None = None,
build_type: str | None = None,
) -> None:
"""Build docker image.
platform == 'linux/arm64' or platform == 'linux/amd64'"""
from batools import version
version_num, build_num = version.get_current_version()
if headless_build is None:
headless_build = True
if build_type is None:
build_type = 'Release'
image_name = get_docker_image_name(
headless_build=headless_build, build_type=build_type
)
if platform is not None and 'arm64' in platform:
config_file = 'config/docker/Dockerfile_arm64'
else:
config_file = 'config/docker/Dockerfile'
print(
f'Building docker image {image_name} '
+ f'version {version_num}:{build_num}'
)
_docker_build(
image_name,
config_file,
labels={
'bombsquad_version': version_num,
'bombsquad_build': str(build_num),
},
platform=platform,
headless_build=headless_build,
cmake_build_type=build_type,
)
def get_docker_image_name(headless_build: bool | str, build_type: str) -> str:
"""Get name of docker images in predefined format."""
name = 'bombsquad'
if headless_build:
name += '_server'
else:
name += '_gui'
if 'release' in build_type.lower():
name += '_release'
else:
name += '_debug'
return name
def docker_save_images() -> None:
"""Saves bombsquad images loaded into docker."""
output = subprocess.run(
['docker', 'images'], capture_output=True, text=True, check=True
)
save_cmd = ['docker', 'save', '-o']
# we expect this directory is already present from Makefile
build_save_dir = 'build/docker/'
img_name = get_docker_image_name(headless_build=True, build_type='Release')
if img_name in output.stdout:
subprocess.run(
save_cmd + [build_save_dir + img_name + '_docker.tar', img_name],
check=True,
)
img_name = get_docker_image_name(headless_build=True, build_type='Debug')
if img_name in output.stdout:
subprocess.run(
save_cmd + [build_save_dir + img_name + '_docker.tar', img_name],
check=True,
)
img_name = get_docker_image_name(headless_build=False, build_type='Release')
if img_name in output.stdout:
subprocess.run(
save_cmd + [build_save_dir + img_name + '_docker.tar', img_name],
check=True,
)
img_name = get_docker_image_name(headless_build=False, build_type='Debug')
if img_name in output.stdout:
subprocess.run(
save_cmd + [build_save_dir + img_name + '_docker.tar', img_name],
check=True,
)
def docker_remove_images() -> None:
"""Remove the bombsquad images loaded in docker."""
output = subprocess.run(
['docker', 'images'], capture_output=True, text=True, check=True
)
remove_cmd = [
'docker',
'rmi',
]
img_name = get_docker_image_name(headless_build=True, build_type='Release')
if img_name in output.stdout:
subprocess.run(remove_cmd + [img_name], check=True)
img_name = get_docker_image_name(headless_build=True, build_type='Debug')
if img_name in output.stdout:
subprocess.run(remove_cmd + [img_name], check=True)
img_name = get_docker_image_name(headless_build=False, build_type='Release')
if img_name in output.stdout:
subprocess.run(remove_cmd + [img_name], check=True)
img_name = get_docker_image_name(headless_build=False, build_type='Debug')
if img_name in output.stdout:
subprocess.run(remove_cmd + [img_name], check=True)

View File

@ -104,7 +104,14 @@ from batools.pcommands import (
ensure_prefab_platform,
prefab_run_var,
prefab_binary_path,
build_docker,
build_docker_gui_release,
build_docker_gui_debug,
build_docker_server_release,
build_docker_server_debug,
build_docker_arm64_gui_release,
build_docker_arm64_server_release,
save_docker_images,
remove_docker_images,
make_prefab,
lazybuild,
efro_gradle,

View File

@ -9,6 +9,7 @@ import sys
from efrotools import pcommand
# pylint: disable=too-many-lines
def prune_includes() -> None:
"""Check for unnecessary includes in C++ files.
@ -667,11 +668,60 @@ def prefab_binary_path() -> None:
)
def build_docker() -> None:
"""Build the docker image with bombsquad cmake server."""
import batools.build
def build_docker_gui_release() -> None:
"""Build the docker image with bombsquad cmake gui."""
import batools.docker
batools.build.docker_build()
batools.docker.docker_build(headless_build=False)
def build_docker_gui_debug() -> None:
"""Build the docker image with bombsquad debug cmake gui."""
import batools.docker
batools.docker.docker_build(headless_build=False, build_type='Debug')
def build_docker_server_release() -> None:
"""Build the docker image with bombsquad cmake server."""
import batools.docker
batools.docker.docker_build()
def build_docker_server_debug() -> None:
"""Build the docker image with bombsquad debug cmake server."""
import batools.docker
batools.docker.docker_build(build_type='Debug')
def build_docker_arm64_gui_release() -> None:
"""Build the docker image with bombsquad cmake for arm64."""
import batools.docker
batools.docker.docker_build(headless_build=False, platform='linux/arm64')
def build_docker_arm64_server_release() -> None:
"""Build the docker image with bombsquad cmake server for arm64."""
import batools.docker
batools.docker.docker_build(platform='linux/arm64')
def save_docker_images() -> None:
"""Saves bombsquad images loaded into docker."""
import batools.docker
batools.docker.docker_save_images()
def remove_docker_images() -> None:
"""Remove the bombsquad images loaded in docker."""
import batools.docker
batools.docker.docker_remove_images()
def make_prefab() -> None:

View File

@ -44,6 +44,7 @@ def dataclass_to_dict(
obj: Any,
codec: Codec = Codec.JSON,
coerce_to_float: bool = True,
discard_extra_attrs: bool = False,
) -> dict:
"""Given a dataclass object, return a json-friendly dict.
@ -62,7 +63,11 @@ def dataclass_to_dict(
"""
out = _Outputter(
obj, create=True, codec=codec, coerce_to_float=coerce_to_float
obj,
create=True,
codec=codec,
coerce_to_float=coerce_to_float,
discard_extra_attrs=discard_extra_attrs,
).run()
assert isinstance(out, dict)
return out
@ -157,14 +162,21 @@ def dataclass_from_json(
def dataclass_validate(
obj: Any, coerce_to_float: bool = True, codec: Codec = Codec.JSON
obj: Any,
coerce_to_float: bool = True,
codec: Codec = Codec.JSON,
discard_extra_attrs: bool = False,
) -> None:
"""Ensure that values in a dataclass instance are the correct types."""
# Simply run an output pass but tell it not to generate data;
# only run validation.
_Outputter(
obj, create=False, codec=codec, coerce_to_float=coerce_to_float
obj,
create=False,
codec=codec,
coerce_to_float=coerce_to_float,
discard_extra_attrs=discard_extra_attrs,
).run()

View File

@ -61,6 +61,29 @@ class IOExtendedData:
type-safe form.
"""
# pylint: disable=useless-return
@classmethod
def handle_input_error(cls, exc: Exception) -> Self | None:
"""Called when an error occurs during input decoding.
This allows a type to optionally return substitute data
to be used in place of the failed decode. If it returns
None, the original exception is re-raised.
It is generally a bad idea to apply catch-alls such as this,
as it can lead to silent data loss. This should only be used
in specific cases such as user settings where an occasional
reset is harmless and is preferable to keeping all contained
enums and other values backward compatible indefinitely.
"""
del exc # Unused.
# By default we let things fail.
return None
# pylint: enable=useless-return
EnumT = TypeVar('EnumT', bound=Enum)

View File

@ -236,6 +236,28 @@ class _Inputter:
sets should be passed as lists, enums should be passed as their
associated values, and nested dataclasses should be passed as dicts.
"""
try:
return self._do_dataclass_from_input(cls, fieldpath, values)
except Exception as exc:
# Extended data types can choose to sub default data in case
# of failures (generally not a good idea but occasionally
# useful).
if issubclass(cls, IOExtendedData):
fallback = cls.handle_input_error(exc)
if fallback is None:
raise
# Make sure fallback gave us the right type.
if not isinstance(fallback, cls):
raise RuntimeError(
f'handle_input_error() was expected to return a {cls}'
f' but returned a {type(fallback)}.'
) from exc
return fallback
raise
def _do_dataclass_from_input(
self, cls: type, fieldpath: str, values: dict
) -> Any:
# pylint: disable=too-many-locals
# pylint: disable=too-many-statements
# pylint: disable=too-many-branches
@ -377,6 +399,7 @@ class _Inputter:
create=False,
codec=self._codec,
coerce_to_float=self._coerce_to_float,
discard_extra_attrs=False,
)
self._soft_default_validator.soft_default_check(
value=value, anntype=anntype, fieldpath=fieldpath

View File

@ -38,12 +38,18 @@ class _Outputter:
"""Validates or exports data contained in a dataclass instance."""
def __init__(
self, obj: Any, create: bool, codec: Codec, coerce_to_float: bool
self,
obj: Any,
create: bool,
codec: Codec,
coerce_to_float: bool,
discard_extra_attrs: bool,
) -> None:
self._obj = obj
self._create = create
self._codec = codec
self._coerce_to_float = coerce_to_float
self._discard_extra_attrs = discard_extra_attrs
def run(self) -> Any:
"""Do the thing."""
@ -133,17 +139,18 @@ class _Outputter:
out[storagename] = outvalue
# If there's extra-attrs stored on us, check/include them.
extra_attrs = getattr(obj, EXTRA_ATTRS_ATTR, None)
if isinstance(extra_attrs, dict):
if not _is_valid_for_codec(extra_attrs, self._codec):
raise TypeError(
f'Extra attrs on \'{fieldpath}\' contains data type(s)'
f' not supported by \'{self._codec.value}\' codec:'
f' {extra_attrs}.'
)
if self._create:
assert out is not None
out.update(extra_attrs)
if not self._discard_extra_attrs:
extra_attrs = getattr(obj, EXTRA_ATTRS_ATTR, None)
if isinstance(extra_attrs, dict):
if not _is_valid_for_codec(extra_attrs, self._codec):
raise TypeError(
f'Extra attrs on \'{fieldpath}\' contains data type(s)'
f' not supported by \'{self._codec.value}\' codec:'
f' {extra_attrs}.'
)
if self._create:
assert out is not None
out.update(extra_attrs)
# If this obj inherits from multi-type, store its type id.
if isinstance(obj, IOMultiType):

View File

@ -28,8 +28,6 @@ from efro.dataclassio import (
)
from efro.terminal import Clr
from efrotools.util import is_wsl_windows_build_path
if TYPE_CHECKING:
import efro.terminal
@ -661,6 +659,8 @@ def _write_cache_file(staging_dir: str, fname: str) -> tuple[str, str, str]:
def _cache_prefix_for_file(fname: str) -> bytes:
# pylint: disable=global-statement
from efrotools.util import is_wsl_windows_build_path
global g_cache_prefix_exec
global g_cache_prefix_noexec