diff --git a/.github/workflows/linux_server_build.yml b/.github/workflows/linux_server_build.yml new file mode 100644 index 0000000000..3ff361a158 --- /dev/null +++ b/.github/workflows/linux_server_build.yml @@ -0,0 +1,289 @@ +# Copyright 2013-2019 High Fidelity, Inc. +# Copyright 2020-2022 Vircadia contributors. +# Copyright 2021-2022 Overte e.V. +# SPDX-License-Identifier: Apache-2.0 + +name: Linux Server CI Build +# Keep in mind that GitHub Actions does not allow reading secrets during PR builds. + +on: + pull_request: + types: [opened, synchronize, reopened, labeled] + push: + branches: + - master + +env: + BUILD_TYPE: Release + + UPLOAD_BUCKET: overte-public + UPLOAD_REGION: fra1 + UPLOAD_ENDPOINT: "https://fra1.digitaloceanspaces.com" + +jobs: + build: + # Only run master or tagged builds, or PRs if labeled as "server" + if: contains( github.event.pull_request.labels.*.name, 'server') || github.event_name != 'pull_request' + name: "${{matrix.os}}, ${{matrix.arch}}" + strategy: + matrix: + include: + - os: debian-11 + image: docker.io/overte/overte-server-build:0.1.2-debian-11-amd64 + arch: amd64 + runner: ubuntu-latest + + - os: debian-11 + image: docker.io/overte/overte-server-build:0.1.2-debian-11-aarch64 + arch: aarch64 + runner: linux_aarch64 + + - os: ubuntu-18.04 + image: docker.io/overte/overte-server-build:0.1.1-ubuntu-18.04-amd64 + arch: amd64 + runner: ubuntu-latest + + - os: ubuntu-20.04 + image: docker.io/overte/overte-server-build:0.1.1-ubuntu-20.04-amd64 + arch: amd64 + runner: ubuntu-latest + + - os: ubuntu-22.04 + image: docker.io/overte/overte-server-build:0.1.1-ubuntu-22.04-amd64 + arch: amd64 + runner: ubuntu-latest + + - os: ubuntu-22.04 + image: docker.io/overte/overte-server-build:0.1.1-ubuntu-22.04-aarch64 + arch: aarch64 + runner: linux_aarch64 + + - os: fedora-36 + image: docker.io/overte/overte-server-build:0.1.2-fedora-36-amd64 + arch: amd64 + runner: ubuntu-latest + + - os: fedora-36 + image: docker.io/overte/overte-server-build:0.1.2-fedora-36-aarch64 + arch: aarch64 + runner: linux_aarch64 + + - os: fedora-37 + image: docker.io/overte/overte-server-build:0.1.2-fedora-37-amd64 + arch: amd64 + runner: ubuntu-latest + + - os: fedora-37 + image: docker.io/overte/overte-server-build:0.1.2-fedora-37-aarch64 + arch: aarch64 + runner: linux_aarch64 + + - os: rockylinux-9 + image: docker.io/overte/overte-server-build:0.1.2-rockylinux-9-amd64 + arch: amd64 + runner: ubuntu-latest + + fail-fast: false + + runs-on: ${{matrix.runner}} + container: ${{matrix.image}} + + steps: + - name: Configure Build Environment 1 + shell: bash + run: | + + # Get git commit + if [ "${{github.event_name}}" = "pull_request" ]; then + echo "GIT_COMMIT_SHORT=`echo ${{ github.event.pull_request.head.sha }} | cut -c1-7`" >> $GITHUB_ENV + else # master or tagged + echo "GIT_COMMIT_SHORT=`echo ${{ github.sha }} | cut -c1-7`" >> $GITHUB_ENV + fi + + echo "JOB_NAME=${{matrix.os}}, ${{matrix.arch}}" >> $GITHUB_ENV + + echo "CMAKE_BUILD_EXTRA=-- -j$(nproc)" >> $GITHUB_ENV + + if [[ "${{ matrix.os }}" =~ "ubuntu" || "${{ matrix.os }}" =~ "debian" ]]; then + echo "INSTALLER_EXT=deb" >> $GITHUB_ENV + echo "DEBEMAIL=julian.gro@overte.org" >> $GITHUB_ENV + echo "DEBFULLNAME=GitHub Actions CI" >> $GITHUB_ENV + else # RPM + if [ "${{ matrix.arch }}" == "amd64" ]; then + echo "INSTALLER_EXT=x86_64.rpm" >> $GITHUB_ENV + else + echo "INSTALLER_EXT=aarch64.rpm" >> $GITHUB_ENV + fi + fi + + # Tagged builds. E.g. release or release candidate builds. + if [ "${{github.event_name}}" != "pull_request" ]; then + echo "PRODUCTION_BUILD=true" >> $GITHUB_ENV + fi + + # Systems requiring our prebuilt Qt package + if [[ "${{ matrix.os }}" = "ubuntu-18.04" || "${{ matrix.os }}" = "ubuntu-20.04" ]]; then + echo # false + else + echo "OVERTE_USE_SYSTEM_QT=true" >> $GITHUB_ENV + fi + + # Architecture specific variables + if [[ "${{ matrix.arch }}" = "aarch64" ]]; then + echo "VCPKG_FORCE_SYSTEM_BINARIES=true" >> $GITHUB_ENV + echo "CMAKE_EXTRA=-DOVERTE_CPU_ARCHITECTURE= -DSERVER_ONLY=true -DBUILD_TOOLS=true" >> $GITHUB_ENV + else # amd64 + echo "CMAKE_EXTRA=-DOVERTE_CPU_ARCHITECTURE=-msse3 -DSERVER_ONLY=true -DBUILD_TOOLS=true" >> $GITHUB_ENV + fi + + # Configuration is broken into multiple steps because you can't set an env var and also reference it in the same step + - name: Configure Build Environment 2 + shell: bash + run: | + + # Versioning + if [ "${{ github.event_name }}" = "pull_request" ]; then + echo "DEBVERSION=${{ github.event.number }}PR-$GIT_COMMIT_SHORT-${{ matrix.os }}" >> $GITHUB_ENV + echo "RPMVERSION=PR${{ github.event.number }}.$GIT_COMMIT_SHORT" >> $GITHUB_ENV + elif [ "${{ github.ref_name }}" = "master" ]; then + echo "DEBVERSION=${{ github.run_number }}master-$GIT_COMMIT_SHORT-${{ matrix.os }}" >> $GITHUB_ENV + echo "RPMVERSION=master${{ github.run_number }}.$GIT_COMMIT_SHORT" >> $GITHUB_ENV + echo "UPLOAD_PREFIX=build/overte/master" >> $GITHUB_ENV + echo "RELEASE_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV + else # tagged + echo "DEBVERSION=${{ github.run_number }}-${{ github.ref_name }}-$GIT_COMMIT_SHORT-${{ matrix.os }}" >> $GITHUB_ENV + echo "RPMVERSION=${${{ github.ref_name }}//-/.}.${{ github.run_number }}.$GIT_COMMIT_SHORT" >> $GITHUB_ENV + fi + + if [[ "${{ github.ref_name }}" != "master" && "${{ github.ref_name }}" != "pull_request" ]]; then # tagged + echo "RELEASE_NUMBER=/${{ github.ref_name }}" >> $GITHUB_ENV + if [ "${{ github.ref_name }}" == *"rc"* ]; then # release candidate + echo "UPLOAD_PREFIX=build/overte/release-candidate" >> $GITHUB_ENV + else # release + echo "UPLOAD_PREFIX=build/overte/release" >> $GITHUB_ENV + fi + fi + + - name: Configure Build Environment 3 + shell: bash + run: | + + if [[ "${{ matrix.os }}" =~ "ubuntu" || "${{ matrix.os }}" =~ "debian" ]]; then + if [ "${{ matrix.arch }}" == "aarch64" ]; then + echo "ARTIFACT_PATTERN=overte-server_${DEBVERSION}-1_arm64.$INSTALLER_EXT" >> $GITHUB_ENV + else # amd64 + echo "ARTIFACT_PATTERN=overte-server_${DEBVERSION}-1_amd64.$INSTALLER_EXT" >> $GITHUB_ENV + fi + else # RPM + if [ "${{ matrix.os }}" == "rockylinux-9" ]; then + echo "ARTIFACT_PATTERN=overte-server-$RPMVERSION-1.el9.$INSTALLER_EXT" >> $GITHUB_ENV + elif [ "${{ matrix.os }}" == "fedora-36" ]; then + echo "ARTIFACT_PATTERN=overte-server-$RPMVERSION-1.fc36.$INSTALLER_EXT" >> $GITHUB_ENV + elif [ "${{ matrix.os }}" == "fedora-37" ]; then + echo "ARTIFACT_PATTERN=overte-server-$RPMVERSION-1.fc37.$INSTALLER_EXT" >> $GITHUB_ENV + else + echo "Error! ARTIFACT_PATTERN not set!" + exit 1 # Fail + fi + fi + + + # Checkout v2 and v3 are currently broken on our Docker configuration + - uses: actions/checkout@v1 + with: + submodules: false + fetch-depth: 1 + + - name: Create Build Environment + shell: bash + run: mkdir build + + - name: Configure CMake + working-directory: build + shell: bash + run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DVCPKG_BUILD_TYPE=release $CMAKE_EXTRA + + - name: Compress cmake logs + if: always() + shell: bash + run: | + + if [ ${{ env.CI_WORKSPACE }} ]; then + find "$CI_WORKSPACE/overte-files/vcpkg" -name '*log' -type f -print0 | tar --null --force-local -T - -c --xz -v -f "cmake-logs-${{ matrix.os }}-${{ matrix.arch }}-${{ github.event.number }}.tar.xz" + else + find "$HOME/overte-files/vcpkg" -name '*log' -type f -print0 | tar --null --force-local -T - -c --xz -v -f "cmake-logs-${{ matrix.os }}-${{ matrix.arch }}-${{ github.event.number }}.tar.xz" + fi + + - name: Archive cmake logs + if: always() + # upload-artifact v2 and v3 are currently broken on our Docker configuration + uses: actions/upload-artifact@v1 + with: + name: cmake-logs-${{ matrix.os }}-${{ matrix.arch }}-${{ github.event.number }}.tar.xz + path: cmake-logs-${{ matrix.os }}-${{ matrix.arch }}-${{ github.event.number }}.tar.xz + + - name: Build Domain Server + working-directory: build + shell: bash + run: cmake --build . --config $BUILD_TYPE --target domain-server $CMAKE_BUILD_EXTRA + + - name: Build Assignment Client + working-directory: build + shell: bash + run: cmake --build . --config $BUILD_TYPE --target assignment-client $CMAKE_BUILD_EXTRA + + - name: Build Oven + working-directory: build + shell: bash + run: cmake --build . --config $BUILD_TYPE --target oven $CMAKE_BUILD_EXTRA + + - name: Package + working-directory: pkg-scripts + shell: bash + run: | + if [[ "${{ matrix.os }}" = "ubuntu"* || "${{ matrix.os }}" = "debian"* ]]; then # Debian + ./make-deb-server + else # RPM + ./make-rpm-server + fi + + - name: Output system stats + if: ${{ always() }} + shell: bash + run: | + echo "Disk usage:" + df -h + + - name: tree + if: always() + shell: bash + run: | + if [[ "${{ matrix.os }}" =~ "ubuntu" || "${{ matrix.os }}" =~ "debian" ]]; then + + echo "Updating apt repository index" + sudo apt update || exit 1 + + echo "Installing apt packages" + sudo apt -y install tree || exit 1 + + else # RPM + dnf -y install tree || exit 1 + fi + tree -f / + + - name: Upload artifact to GitHub + if: github.event_name == 'pull_request' + # upload-artifact v2 and v3 are currently broken on our Docker configuration + uses: actions/upload-artifact@v1 + with: + name: ${{ env.ARTIFACT_PATTERN }} + path: pkg-scripts/${{ env.ARTIFACT_PATTERN }} + + - name: Upload artifact to S3 + if: github.event_name != 'pull_request' # PR builds cannot be uploaded to S3 + shell: bash + working-directory: pkg-scripts + env: + AWS_ACCESS_KEY_ID: ${{ secrets.s3_access_key_id }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.s3_secret_access_key }} + run: python3 $GITHUB_WORKSPACE/tools/ci-scripts/upload.py diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml index 49781e274e..3326cdcf45 100644 --- a/.github/workflows/pr_build.yml +++ b/.github/workflows/pr_build.yml @@ -14,7 +14,7 @@ env: APP_NAME: interface BUILD_TYPE: Release CI_BUILD: Github - GIT_COMMIT: ${{ github.sha }} + GIT_COMMIT: ${{ github.event.pull_request.head.sha }} # VCPKG did not build well on OSX disabling HIFI_VCPKG_BOOTSTRAP, which invokes a download to a working version of vcpkg # HIFI_VCPKG_BOOTSTRAP: true RELEASE_TYPE: PR @@ -69,7 +69,8 @@ jobs: id: buildenv1 run: | - echo "{github_sha_short}={`echo $GIT_COMMIT | cut -c1-7`}" >> $GITHUB_OUTPUT + # Setting short commit SHA for use as RELEASE_NAME in generated installers. + echo "GIT_COMMIT_SHORT=`echo $GIT_COMMIT | cut -c1-7`" >> $GITHUB_ENV echo "JOB_NAME=${{matrix.os}}, ${{matrix.build_type}}" >> $GITHUB_ENV echo "APP_TARGET_NAME=$APP_NAME" >> $GITHUB_ENV @@ -78,12 +79,12 @@ jobs: echo "PYTHON_EXEC=python3" >> $GITHUB_ENV echo "INSTALLER_EXT=*" >> $GITHUB_ENV echo "CMAKE_BUILD_EXTRA=-- -j$(nproc)" >> $GITHUB_ENV + # Don't optimize builds to save build time. + echo "OVERTE_OPTIMIZE=false" >> $GITHUB_ENV # Variables specific to our aarch64 runner if [ "${{ matrix.os }}" = "self-hosted_debian-11_aarch64" ]; then echo "OVERTE_USE_SYSTEM_QT=true" >> $GITHUB_ENV echo "CI_WORKSPACE=${{runner.workspace}}" >> $GITHUB_ENV - # Don't optimize builds to save build time. - echo "OVERTE_OPTIMIZE=false" >> $GITHUB_ENV fi if [[ "${{ matrix.os }}" = *"aarch64" ]]; then @@ -140,14 +141,12 @@ jobs: run: | echo "${{ steps.buildenv1.outputs.symbols_archive }}" - # Setting short commit SHA for use as RELEASE_NAME in generated installers. - echo "GIT_COMMIT_SHORT=${{ steps.buildenv1.outputs.github_sha_short }}" >> $GITHUB_ENV if [ "${{ matrix.build_type }}" = "full" ]; then - echo "ARTIFACT_PATTERN=Overte-PR${{ github.event.number }}-${{ steps.buildenv1.outputs.github_sha_short }}.$INSTALLER_EXT" >> $GITHUB_ENV - echo "INSTALLER=Overte-$RELEASE_NUMBER-${{ steps.buildenv1.outputs.github_sha_short }}.$INSTALLER_EXT" >> $GITHUB_ENV + echo "ARTIFACT_PATTERN=Overte-PR${{ github.event.number }}-${GIT_COMMIT_SHORT}.$INSTALLER_EXT" >> $GITHUB_ENV + echo "INSTALLER=Overte-$RELEASE_NUMBER-${GIT_COMMIT_SHORT}.$INSTALLER_EXT" >> $GITHUB_ENV else - echo "ARTIFACT_PATTERN=Overte-Interface-PR${{ github.event.number }}-${{ steps.buildenv1.outputs.github_sha_short }}.$INSTALLER_EXT" >> $GITHUB_ENV - echo "INSTALLER=Overte-Interface-$RELEASE_NUMBER-${{ steps.buildenv1.outputs.github_sha_short }}.$INSTALLER_EXT" >> $GITHUB_ENV + echo "ARTIFACT_PATTERN=Overte-Interface-PR${{ github.event.number }}-${GIT_COMMIT_SHORT}.$INSTALLER_EXT" >> $GITHUB_ENV + echo "INSTALLER=Overte-Interface-$RELEASE_NUMBER-${GIT_COMMIT_SHORT}.$INSTALLER_EXT" >> $GITHUB_ENV fi - name: Clear Working Directory diff --git a/CMakeLists.txt b/CMakeLists.txt index 46c53607ef..f49d020c6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,8 @@ +# Copyright 2013-2019 High Fidelity, Inc. +# Copyright 2019-2021 Vircadia contributors. +# Copyright 2020-2022 Overte e.V. +# SPDX-License-Identifier: Apache-2.0 + # If we're running under the gradle build, HIFI_ANDROID will be set here, but # ANDROID will not be set until after the `project` statement. This is the *ONLY* # place you need to use `HIFI_ANDROID` instead of `ANDROID` diff --git a/INSTALLER.md b/INSTALLER.md index 8cfac6b8d5..19614c1abe 100644 --- a/INSTALLER.md +++ b/INSTALLER.md @@ -136,7 +136,7 @@ For code signing to work, you will need to set the `HF_PFX_FILE` and `HF_PFX_PAS 1. Build Docker image as instructed in the relevant Dockerfile in [tools/ci-scripts/deb_package/](tools/ci-scripts/deb_package/) 2. Create/Start container - Example: `docker run -v $(pwd)/../../..:/overte -it juliangro/overte-server-build:0.1.1-debian-11` + Example: `docker run -v $(pwd)/../../..:/overte -it overte/overte-server-build:0.1.2-debian-11-amd64` 3. Prepare build environment ```bash @@ -175,7 +175,7 @@ DEBVERSION="1-experimental-ubuntu-18.04" DEBEMAIL="julian.gro@overte.org" DEBFUL 1. Build Docker image as instructed in the relevant Dockerfile in [tools/ci-scripts/rpm_package/](tools/ci-scripts/rpm_package/) 2. Create/Start container - Example: `docker run -v $(pwd)/../../..:/overte -it juliangro/overte-server-build:0.1.1-fedora-36` + Example: `docker run -v $(pwd)/../../..:/overte -it overte/overte-server-build:0.1.2-fedora-36-amd64` 3. Prepare build environment ```bash diff --git a/hifi_qt.py b/hifi_qt.py index 4f133dabbb..9161e33435 100644 --- a/hifi_qt.py +++ b/hifi_qt.py @@ -1,3 +1,8 @@ +# Copyright 2013-2019 High Fidelity, Inc. +# Copyright 2020-2022 Vircadia contributors. +# Copyright 2020-2022 Overte e.V. +# SPDX-License-Identifier: Apache-2.0 + import hifi_utils import hifi_android import hashlib @@ -62,7 +67,7 @@ endif() system_qt = False # Here we handle the 3 possible cases of dealing with Qt: - if os.getenv('OVERTE_USE_SYSTEM_QT', "") != "": + if bool(os.getenv('OVERTE_USE_SYSTEM_QT', False)): # 1. Using the system provided Qt. This is only recommended for Qt 5.15.0 and above, # as it includes a required fix on Linux. # diff --git a/pkg-scripts/README.md b/pkg-scripts/README.md index fa21a53f07..e2d0a4d7be 100644 --- a/pkg-scripts/README.md +++ b/pkg-scripts/README.md @@ -1,3 +1,9 @@ + + # Overte Server Packaging Scripts Collection of scripts to create server distribution packages. Most of these scripts assume diff --git a/pkg-scripts/make-deb-server b/pkg-scripts/make-deb-server index 8f19fe12fe..369751f3fb 100755 --- a/pkg-scripts/make-deb-server +++ b/pkg-scripts/make-deb-server @@ -1,14 +1,22 @@ #!/bin/sh +# Copyright 2020-2021 Vircadia contributors. +# Copyright 2022 Overte e.V. +# SPDX-License-Identifier: Apache-2.0 + if [ "$OVERTE" = "" ]; then OVERTE=`realpath ..` - QT5_LIBS=`realpath ~/overte-files/qt/qt5-install/lib` + if [ ! "$OVERTE_USE_SYSTEM_QT" ]; then + QT5_LIBS=`realpath ~/overte-files/qt/qt5-install/lib` + fi fi sudo apt-get install chrpath binutils dh-make DEB_BUILD_ROOT=temp-make-deb/overte-server_$DEBVERSION -rm -r temp-make-deb +if [ -d temp-make-deb ]; then + rm -r temp-make-deb +fi mkdir -p $DEB_BUILD_ROOT # copy the files over @@ -18,7 +26,7 @@ cp $OVERTE/build/tools/oven/oven $DEB_BUILD_ROOT # Oven is required for pre-bak cp $OVERTE/build/libraries/*/*.so $DEB_BUILD_ROOT #cp $OVERTE/build/ice-server/ice-server $DEB_BUILD_ROOT chrpath -d $DEB_BUILD_ROOT/* -if [ "$OVERTE_USE_SYSTEM_QT" = "" ]; then +if [ ! "$OVERTE_USE_SYSTEM_QT" ]; then cp $QT5_LIBS/libQt5Network.so.*.*.* $DEB_BUILD_ROOT cp $QT5_LIBS/libQt5Core.so.*.*.* $DEB_BUILD_ROOT cp $QT5_LIBS/libQt5Widgets.so.*.*.* $DEB_BUILD_ROOT @@ -69,7 +77,7 @@ echo domain-server opt/overte >> debian/install echo oven opt/overte >> debian/install #echo ice-server opt/overte >> debian/install echo new-server opt/overte >> debian/install -if [ "$OVERTE_USE_SYSTEM_QT" = "" ]; then +if [ ! "$OVERTE_USE_SYSTEM_QT" ]; then for so in *.so.*.*.*; do echo $so opt/overte/lib >> debian/install done @@ -86,7 +94,7 @@ done find resources -type f -exec sh -c 'echo {} opt/overte/$(dirname "{}") >> debian/install' \; find plugins -type f -exec sh -c 'echo {} opt/overte/$(dirname "{}") >> debian/install' \; -if [ "$OVERTE_USE_SYSTEM_QT" = "" ]; then +if [ ! "$OVERTE_USE_SYSTEM_QT" ]; then SOFILES=`ls *.so *.so.*.*.* | grep -Po '^(.+\.so(\.\d+)?)' | sed 's/\./\\\./g' | paste -d'|' -s` else SOFILES=`ls *.so | grep -Po '^(.+\.so(\.\d+)?)' | sed 's/\./\\\./g' | paste -d'|' -s` @@ -101,3 +109,4 @@ sed "s/{DEPENDS}/$DEPENDS/" $OVERTE/pkg-scripts/server-control > debian/control dpkg-buildpackage -us -uc +mv $OVERTE/pkg-scripts/temp-make-deb/*.deb $OVERTE/pkg-scripts/ # move package out of temp-make-deb diff --git a/pkg-scripts/make-rpm-server b/pkg-scripts/make-rpm-server index 9fa249548f..1f1f14f607 100755 --- a/pkg-scripts/make-rpm-server +++ b/pkg-scripts/make-rpm-server @@ -1,5 +1,9 @@ #!/bin/sh +# Copyright 2020-2021 Vircadia contributors. +# Copyright 2022 Overte e.V. +# SPDX-License-Identifier: Apache-2.0 + if [ "$OVERTE" = "" ]; then OVERTE=`realpath ..` QT5_LIBS=`realpath ~/overte-files/qt/qt5-install/lib` @@ -76,5 +80,5 @@ fi sudo yum install chrpath export VERSION DEPENDS OVERTE -rpmbuild --target x86_64 -bb ./overte-server.spec -mv ~/rpmbuild/RPMS/x86_64/*.rpm . +rpmbuild --target $(uname -m) -bb ./overte-server.spec +mv ~/rpmbuild/RPMS/$(uname -m)/*.rpm . diff --git a/pkg-scripts/overte-server.spec b/pkg-scripts/overte-server.spec index 56b496e89b..70101311c3 100644 --- a/pkg-scripts/overte-server.spec +++ b/pkg-scripts/overte-server.spec @@ -1,3 +1,7 @@ +# Copyright 2020-2021 Vircadia contributors. +# Copyright 2022 Overte e.V. +# SPDX-License-Identifier: Apache-2.0 + #OVERTE=~/Overte rpmbuild --target x86_64 -bb overte-server.spec %define version %{lua:print(os.getenv("VERSION"))} %define depends %{lua:print(os.getenv("DEPENDS"))} @@ -14,7 +18,10 @@ Source0: https://github.com/overte-org/overte #BuildRequires: systemd-rpm-macros BuildRequires: chrpath Requires: %{depends} -BuildArch: x86_64 + +BuildArch: %_target_cpu + + AutoReq: no AutoProv: no diff --git a/pkg-scripts/server-compat.license b/pkg-scripts/server-compat.license new file mode 100644 index 0000000000..4c7518c2de --- /dev/null +++ b/pkg-scripts/server-compat.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2022 Overte e.V. +SPDX-License-Identifier: MIT diff --git a/pkg-scripts/server-control b/pkg-scripts/server-control index ca6947ad55..1d45259eff 100644 --- a/pkg-scripts/server-control +++ b/pkg-scripts/server-control @@ -1,3 +1,7 @@ +# Copyright 2020-2021 Vircadia contributors. +# Copyright 2022 Overte e.V. +# SPDX-License-Identifier: Apache-2.0 + Source: overte-server Section: comm Priority: optional diff --git a/pkg-scripts/server-rules b/pkg-scripts/server-rules index eb3a59c591..c91f700aa7 100755 --- a/pkg-scripts/server-rules +++ b/pkg-scripts/server-rules @@ -1,4 +1,9 @@ #!/usr/bin/make -f + +# Copyright 2020-2021 Vircadia contributors. +# Copyright 2022 Overte e.V. +# SPDX-License-Identifier: Apache-2.0 + # See debhelper(7) (uncomment to enable) # output every command that modifies files on the build system. #export DH_VERBOSE = 1 diff --git a/tools/ci-scripts/deb_package/Dockerfile_build_debian-11 b/tools/ci-scripts/deb_package/Dockerfile_build_debian-11 index 5057493883..e005490e9e 100644 --- a/tools/ci-scripts/deb_package/Dockerfile_build_debian-11 +++ b/tools/ci-scripts/deb_package/Dockerfile_build_debian-11 @@ -1,5 +1,8 @@ +# Copyright 2022 Overte e.V. +# SPDX-License-Identifier: MIT + # Docker file for building Overte Server -# Example build: docker build -t juliangro/overte-server-build:0.1.1-debian-11 -f Dockerfile_build_debian-11 . +# Example build: docker build -t overte/overte-server-build:0.1.2-debian-11 -f Dockerfile_build_debian-11 . FROM debian:bullseye LABEL maintainer="Julian Groß (julian.gro@overte.org)" LABEL description="Development image for Overte Domain server and assignment clients." @@ -12,7 +15,12 @@ RUN echo UTC >/etc/timezone RUN apt-get update && apt-get -y install tzdata # Install Overte domain-server and assignment-client build dependencies -RUN apt-get -y install curl ninja-build git cmake g++ libssl-dev libqt5websockets5-dev qtscript5-dev qtdeclarative5-dev qtmultimedia5-dev python3-distutils python3-distro mesa-common-dev libgl1-mesa-dev +RUN apt-get -y install curl ninja-build git g++ libssl-dev libqt5websockets5-dev qtscript5-dev qtdeclarative5-dev qtmultimedia5-dev python3-distutils python3-distro mesa-common-dev libgl1-mesa-dev + +# Install CMake from Debian Backports +RUN echo deb http://deb.debian.org/debian bullseye-backports main > /etc/apt/sources.list.d/bullseye-backports.list +RUN apt-get update && apt-get -y -t bullseye-backports install -y cmake + # Install Overte tools build dependencies RUN apt-get -y install libqt5webchannel5-dev qtwebengine5-dev libqt5xmlpatterns5-dev @@ -31,8 +39,5 @@ RUN echo "export LC_ALL=en_US.UTF-8" >> ~/.bashrc RUN echo "export LANG=en_US.UTF-8" >> ~/.bashrc RUN echo "export LANGUAGE=en_US.UTF-8" >> ~/.bashrc -# Install tools for creating the server image -RUN apt-get -y install docker.io xz-utils - # Install tools needed for our Github Actions Workflow Run apt-get -y install python3-boto3 python3-github zip diff --git a/tools/ci-scripts/deb_package/Dockerfile_build_ubuntu-18.04 b/tools/ci-scripts/deb_package/Dockerfile_build_ubuntu-18.04 index 07d32d66f8..e964a99718 100644 --- a/tools/ci-scripts/deb_package/Dockerfile_build_ubuntu-18.04 +++ b/tools/ci-scripts/deb_package/Dockerfile_build_ubuntu-18.04 @@ -1,5 +1,8 @@ +# Copyright 2022 Overte e.V. +# SPDX-License-Identifier: MIT + # Docker file for building Overte Server -# Example build: docker build -t juliangro/overte-server-build:0.1.1-ubuntu-18.04 -f Dockerfile_build_ubuntu-18.04 . +# Example build: docker build -t overte/overte-server-build:0.1.1-ubuntu-18.04 -f Dockerfile_build_ubuntu-18.04 . FROM ubuntu:18.04 LABEL maintainer="Julian Groß (julian.gro@overte.org)" LABEL description="Development image for Overte Domain server and assignment clients." diff --git a/tools/ci-scripts/deb_package/Dockerfile_build_ubuntu-20.04 b/tools/ci-scripts/deb_package/Dockerfile_build_ubuntu-20.04 index df8a78167c..c91ff98f02 100644 --- a/tools/ci-scripts/deb_package/Dockerfile_build_ubuntu-20.04 +++ b/tools/ci-scripts/deb_package/Dockerfile_build_ubuntu-20.04 @@ -1,5 +1,8 @@ +# Copyright 2022 Overte e.V. +# SPDX-License-Identifier: MIT + # Docker file for building Overte Server -# Example build: docker build -t juliangro/overte-server-build:0.1.1-ubuntu-20.04 -f Dockerfile_build_ubuntu-20.04 . +# Example build: docker build -t overte/overte-server-build:0.1.1-ubuntu-20.04 -f Dockerfile_build_ubuntu-20.04 . FROM ubuntu:20.04 LABEL maintainer="Julian Groß (julian.gro@overte.org)" LABEL description="Development image for Overte Domain server and assignment clients." diff --git a/tools/ci-scripts/deb_package/Dockerfile_build_ubuntu-22.04 b/tools/ci-scripts/deb_package/Dockerfile_build_ubuntu-22.04 index c5ff27c0e4..6587dce152 100644 --- a/tools/ci-scripts/deb_package/Dockerfile_build_ubuntu-22.04 +++ b/tools/ci-scripts/deb_package/Dockerfile_build_ubuntu-22.04 @@ -1,5 +1,8 @@ +# Copyright 2022 Overte e.V. +# SPDX-License-Identifier: MIT + # Docker file for building Overte Server -# Example build: docker build -t juliangro/overte-server-build:0.1.1-ubuntu-22.04 -f Dockerfile_build_ubuntu-22.04 . +# Example build: docker build -t overte/overte-server-build:0.1.1-ubuntu-22.04 -f Dockerfile_build_ubuntu-22.04 . FROM ubuntu:22.04 LABEL maintainer="Julian Groß (julian.gro@overte.org)" LABEL description="Development image for Overte Domain server and assignment clients." @@ -31,8 +34,5 @@ RUN echo "export LC_ALL=en_US.UTF-8" >> ~/.bashrc RUN echo "export LANG=en_US.UTF-8" >> ~/.bashrc RUN echo "export LANGUAGE=en_US.UTF-8" >> ~/.bashrc -# Install tools for creating the server image -RUN apt-get -y install docker.io xz-utils - # Install tools needed for our Github Actions Workflow Run apt-get -y install python3-boto3 python3-github zip diff --git a/tools/ci-scripts/docker_package/README.md b/tools/ci-scripts/docker_package/README.md index 82cce91873..f8628852c2 100644 --- a/tools/ci-scripts/docker_package/README.md +++ b/tools/ci-scripts/docker_package/README.md @@ -1,21 +1,26 @@ + + This directory contains scripts used for building Linux server Docker images. We are building Debian 11 based images for x86_64 and aarch64. To build images for both architectures, you first create them with separate tags (e.g. 0.1-aarch64 and 0.1-amd64), push them, and then you use *docker manifest* to link them together. E.g.: ```bash -docker manifest create overte-org/overte-server-build:0.1 --amend overte-org/overte-server-build:0.1-amd64 --amend overte-org/overte-server-build:0.1-aarch64 +docker manifest create overte/overte-server-build:0.1 --amend overte/overte-server-build:0.1-amd64 --amend overte/overte-server-build:0.1-aarch64 ``` Then you push the manifest similar to how you would push an image: ```bash -docker manifest push overte-org/overte-server-build:0.1 +docker manifest push overte/overte-server-build:0.1 ``` *Dockerfile_build* generates an image that is used to build our Overte Docker Server images. It includes all dependencies for building a server. -Current images are available at https://hub.docker.com/repository/docker/juliangro/overte-server-build +Current images are available at https://hub.docker.com/repository/docker/overte/overte-server-build *Dockerfile_runtime_linuxbase* generates a runtime base image for our Server. It includes all dependencies for running a server. -Current images are available at https://hub.docker.com/repository/docker/juliangro/overte-server-base +Current images are available at https://hub.docker.com/repository/docker/overte/overte-server-base *Dockerfile_runtime* installs the built server into an image that uses the overte-server-base as a base. The resulting image can be pushed to a Docker repository, or exported, compressed, and published via other means like the https://public.overte.org/index.html diff --git a/tools/ci-scripts/rpm_package/Dockerfile_build_fedora-36 b/tools/ci-scripts/rpm_package/Dockerfile_build_fedora-36 index adae061151..f5eae173fd 100644 --- a/tools/ci-scripts/rpm_package/Dockerfile_build_fedora-36 +++ b/tools/ci-scripts/rpm_package/Dockerfile_build_fedora-36 @@ -1,5 +1,8 @@ +# Copyright 2022 Overte e.V. +# SPDX-License-Identifier: MIT + # Docker file for building Overte Server -# Example build: docker build -t juliangro/overte-server-build:0.1.1-fedora-36 -f Dockerfile_build_fedora-36 . +# Example build: docker build -t overte/overte-server-build:0.1.2-fedora-36 -f Dockerfile_build_fedora-36 . FROM fedora:36 LABEL maintainer="Julian Groß (julian.gro@overte.org)" LABEL description="Development image for Overte Domain server and assignment clients." @@ -12,3 +15,6 @@ RUN dnf -y install zip unzip # Install tools for package creation RUN dnf -y install chrpath rpmdevtools + +# Install tools needed for our Github Actions Workflow +Run dnf -y install python3-boto3 python3-pygithub diff --git a/tools/ci-scripts/rpm_package/Dockerfile_build_fedora-37 b/tools/ci-scripts/rpm_package/Dockerfile_build_fedora-37 new file mode 100644 index 0000000000..eb4c2ac326 --- /dev/null +++ b/tools/ci-scripts/rpm_package/Dockerfile_build_fedora-37 @@ -0,0 +1,20 @@ +# Copyright 2022 Overte e.V. +# SPDX-License-Identifier: MIT + +# Docker file for building Overte Server +# Example build: docker build -t overte/overte-server-build:0.1.2-fedora-37 -f Dockerfile_build_fedora-37 . +FROM fedora:37 +LABEL maintainer="Julian Groß (julian.gro@overte.org)" +LABEL description="Development image for Overte Domain server and assignment clients." + +# Install Overte domain-server and assignment-client build dependencies +RUN dnf -y install curl ninja-build git cmake gcc-c++ openssl-devel qt5-qtwebsockets-devel qt5-qtscript-devel qt5-qtmultimedia-devel unzip libXext-devel qt5-qtwebchannel-devel qt5-qtwebengine-devel qt5-qtxmlpatterns-devel + +# Install additional build tools +RUN dnf -y install zip unzip + +# Install tools for package creation +RUN dnf -y install chrpath rpmdevtools + +# Install tools needed for our Github Actions Workflow +Run dnf -y install python3-boto3 python3-pygithub diff --git a/tools/ci-scripts/rpm_package/Dockerfile_build_rockylinux-9 b/tools/ci-scripts/rpm_package/Dockerfile_build_rockylinux-9 index 0747e3bce7..fa4cb375ee 100644 --- a/tools/ci-scripts/rpm_package/Dockerfile_build_rockylinux-9 +++ b/tools/ci-scripts/rpm_package/Dockerfile_build_rockylinux-9 @@ -1,5 +1,8 @@ +# Copyright 2022 Overte e.V. +# SPDX-License-Identifier: MIT + # Docker file for building Overte Server -# Example build: docker build -t juliangro/overte-server-build:0.1.1-rockylinux-9 -f Dockerfile_build_rockylinux-9 . +# Example build: docker build -t overte/overte-server-build:0.1.2-rockylinux-9 -f Dockerfile_build_rockylinux-9 . FROM rockylinux:9 LABEL maintainer="Julian Groß (julian.gro@overte.org)" LABEL description="Development image for Overte Domain server and assignment clients." @@ -20,3 +23,6 @@ RUN dnf -y install zip unzip # Install tools for package creation RUN dnf -y install chrpath rpmdevtools + +# Install tools needed for our Github Actions Workflow +Run dnf -y install python3-boto3 python3-github diff --git a/tools/ci-scripts/upload.py b/tools/ci-scripts/upload.py index 6ee630aaa5..0a88efecf3 100644 --- a/tools/ci-scripts/upload.py +++ b/tools/ci-scripts/upload.py @@ -1,3 +1,8 @@ +# Copyright 2013-2019 High Fidelity, Inc. +# Copyright 2020 Vircadia contributors. +# Copyright 2022 Overte e.V. +# SPDX-License-Identifier: Apache-2.0 + # Post build script import os import sys diff --git a/tools/ci-scripts/upload_to_publish_server.py b/tools/ci-scripts/upload_to_publish_server.py deleted file mode 100644 index 8d5886a9bc..0000000000 --- a/tools/ci-scripts/upload_to_publish_server.py +++ /dev/null @@ -1,78 +0,0 @@ -import os -import json -from hashlib import sha256 -import http.client -from http import HTTPStatus -import time -import struct -import random -import glob - -FILE_READ_BUFFER = 4096 - -path = os.path.join(os.getcwd(), os.environ['ARTIFACT_PATTERN']) -files = glob.glob(path, recursive=False) -uploading_files = [] -for archive_file in files: - file = open(archive_file, 'rb') - sha256_hash = sha256() - file.seek(0, 0) - for byte_block in iter(lambda: file.read(FILE_READ_BUFFER), b""): - sha256_hash.update(byte_block) - - checksum = sha256_hash.hexdigest() - - uploading_files.append({ - "filename": os.path.basename(archive_file), - "sha256_checksum": checksum, - "file_length": file.tell() - }) - file.close() - -print("BuildFileHashes: " + json.dumps(uploading_files)) - -file_contents = [] -file_sizes = [] - -for archiveFile in files: - file = open(archiveFile, 'rb') - file_data = file.read() - file_sizes.append(len(file_data)) - file_contents.append(file_data) - file.close() - -# Connect to an instance of https://github.com/JulianGro/gha-artifact-uploader -conn = http.client.HTTPConnection("artifact-uploader.overte.org:3000") - -context = json.loads(os.environ['GITHUB_CONTEXT']) - -owner_and_repository = context["repository"].split("/") -owner = owner_and_repository[0] -repository = owner_and_repository[1] - -headers = { - "owner": owner, - "repo": repository, - "commit_hash": context["event"]["pull_request"]["head"]["sha"], - "pull_number": context["event"]["number"], - "job_name": os.environ["JOB_NAME"], - "run_id": context["run_id"], - "file_sizes": ','.join(str(e) for e in file_sizes) -} - -concat_file_body = b''.join(file_contents) - -print("Total files size: " + str(len(concat_file_body))) - -conn.request("PUT", "/", body=concat_file_body, headers=headers) -response = conn.getresponse() - -EXIT_CODE_OK = 0 -EXIT_CODE_ERROR = 1 - -if (response.status == HTTPStatus.OK): - print("response: ", json.loads(response.read())) - exit(EXIT_CODE_OK) -else: - print(response.status, response.reason, response.read()) - exit(EXIT_CODE_ERROR)