[ 
https://issues.apache.org/jira/browse/DISPATCH-1739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17172302#comment-17172302
 ] 

ASF GitHub Bot commented on DISPATCH-1739:
------------------------------------------

gemmellr commented on a change in pull request #809:
URL: https://github.com/apache/qpid-dispatch/pull/809#discussion_r466358519



##########
File path: .github/workflows/build.yaml
##########
@@ -0,0 +1,199 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: Build
+
+on: [push, pull_request]
+
+jobs:
+  compile:
+    name: "Compile (${{matrix.os}}, ${{matrix.runtimeCheck}})"
+    runs-on: ${{ matrix.os }}
+    strategy:
+      fail-fast: false
+      matrix:
+        os: [ubuntu-20.04]
+        buildType: [RelWithDebInfo]
+        runtimeCheck: [asan]
+    env:
+      BuildType: ${{matrix.buildType}}
+      ProtonBuildDir: ${{github.workspace}}/qpid-proton/build
+      DispatchBuildDir: ${{github.workspace}}/qpid-dispatch/build
+      InstallPrefix: ${{github.workspace}}/install
+
+      ProtonCMakeExtraArgs: '-DCMAKE_C_COMPILER_LAUNCHER=ccache 
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DBUILD_BINDINGS=python 
-DRUNTIME_CHECK=${{matrix.runtimeCheck}}'
+      DispatchCMakeExtraArgs: '-DCMAKE_C_COMPILER_LAUNCHER=ccache 
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCONSOLE_INSTALL=OFF 
-DCMAKE_C_FLAGS=-DQD_MEMORY_DEBUG -DRUNTIME_CHECK=${{matrix.runtimeCheck}}'
+
+      CCACHE_BASEDIR: ${{github.workspace}}
+      CCACHE_DIR: ${{github.workspace}}/.ccache
+      CCACHE_COMPRESS: 'true'
+      CCACHE_MAXSIZE: '400MB'
+    steps:
+
+      - name: Show environment (Linux)
+        if: ${{ always() && runner.os == 'Linux' }}
+        run: env -0 | sort -z | tr '\0' '\n'
+
+      - uses: actions/checkout@v2
+        with:
+          repository: 'apache/qpid-proton'
+          ref: 'master'
+          path: 'qpid-proton'
+
+      - uses: actions/checkout@v2
+        with:
+          path: 'qpid-dispatch'
+
+      # 
https://cristianadam.eu/20200113/speeding-up-c-plus-plus-github-actions-using-ccache/
+      - name: Prepare ccache timestamp
+        id: ccache_cache_timestamp
+        shell: cmake -P {0}
+        run: |
+          string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
+          message("::set-output name=timestamp::${current_date}")
+
+      - uses: actions/cache@v2
+        env:
+          cache-name: cache-ccache
+        with:
+          path: .ccache
+          key: ${{ matrix.os }}-${{ matrix.runtimeCheck }}-${{ env.cache-name 
}}-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
+          restore-keys: |
+            ${{ matrix.os }}-${{ matrix.runtimeCheck }}-${{ env.cache-name }}
+
+      - name: Create Build and Install directories
+        run: mkdir -p "${ProtonBuildDir}" "${DispatchBuildDir}" 
"{InstallPrefix}"
+
+      - name: Setup python
+        uses: actions/setup-python@v2
+        with:
+          python-version: 3.6
+          architecture: x64
+
+      - name: Install python dependencies
+        run: python -m pip install setuptools wheel tox
+
+      - name: Install Linux dependencies
+        if: ${{ runner.os == 'Linux' }}
+        run: |
+          sudo apt install -y swig libpython3-dev libsasl2-dev libjsoncpp-dev 
libwebsockets-dev ccache ninja-build pixz
+
+      - name: Zero ccache stats
+        run: ccache -z
+
+      - name: qpid-proton cmake configure
+        working-directory: ${{env.ProtonBuildDir}}
+        run: cmake "${{github.workspace}}/qpid-proton" 
"-DCMAKE_INSTALL_PREFIX=${InstallPrefix}" "-DCMAKE_BUILD_TYPE=${BuildType}" 
"-DBUILD_TESTING=OFF" "-DENABLE_FUZZ_TESTING=OFF" "-GNinja" 
${ProtonCMakeExtraArgs}
+
+      - name: qpid-proton cmake build/install
+        run: cmake --build "${ProtonBuildDir}" --config ${BuildType} -t install
+
+      - name: Display ccache stats
+        run: ccache -s
+
+      - name: qpid-dispatch cmake configure
+        working-directory: ${{env.DispatchBuildDir}}
+        run: cmake "${{github.workspace}}/qpid-dispatch" 
"-DCMAKE_INSTALL_PREFIX=${InstallPrefix}" "-DCMAKE_BUILD_TYPE=${BuildType}" 
"-GNinja" "-DUSE_BWRAP=ON" ${DispatchCMakeExtraArgs}
+
+      - name: qpid-dispatch cmake build/install
+        run: cmake --build "${DispatchBuildDir}" --config ${BuildType} -t 
install
+
+      - name: Display ccache stats
+        run: ccache -s
+
+      # github actions/upload-artifact@v2 does not preserve executable 
permission on binaries
+      - name: Compress build
+        working-directory: ${{github.workspace}}
+        run: tar -I pixz -cf /tmp/archive.tar.xz --exclude '*.o' --exclude 
'*.pyc' --exclude '.git' --exclude='qpid-dispatch/build/console' qpid-dispatch 
install qpid-proton/build/python/pkgs
+
+      - name: Upload archive
+        uses: actions/upload-artifact@v2
+        with:
+          name: 
qpid_dispatch_wrk_${{matrix.os}}_${{matrix.buildType}}_${{matrix.runtimeCheck}}
+          path: /tmp/archive.tar.xz
+
+  test:
+    name: 'Test (${{matrix.os}}, ${{matrix.runtimeCheck}}, shard 
${{matrix.shard}} of ${{matrix.shards}})'
+    runs-on: ${{ matrix.os }}
+    needs: [compile]
+    strategy:
+      fail-fast: false
+      matrix:
+        os: [ubuntu-20.04]
+        buildType: [RelWithDebInfo]
+        runtimeCheck: [asan]
+        shard: [1, 2]
+        shards: [2]
+    env:
+      BuildType: ${{matrix.buildType}}
+      ProtonBuildDir: ${{github.workspace}}/qpid-proton/build
+      DispatchBuildDir: ${{github.workspace}}/qpid-dispatch/build
+      InstallPrefix: ${{github.workspace}}/install
+      LD_LIBRARY_PATH: ${{github.workspace}}/install/lib
+    steps:
+
+      - name: Show environment (Linux)
+        if: ${{ always() && runner.os == 'Linux' }}
+        run: env -0 | sort -z | tr '\0' '\n'
+
+      - name: Download Build
+        uses: actions/download-artifact@v2
+        with:
+          name: 
qpid_dispatch_wrk_${{matrix.os}}_${{matrix.buildType}}_${{matrix.runtimeCheck}}
+
+      - name: Setup python
+        uses: actions/setup-python@v2
+        with:
+          python-version: 3.6
+          architecture: x64
+
+      - name: Install python dependencies
+        run: python -m pip install tox
+
+      - name: Install Linux dependencies
+        if: ${{ runner.os == 'Linux' }}
+        run: |
+          sudo apt install -y libsasl2-2 libsasl2-modules sasl2-bin 
libjsoncpp1 libwebsockets15 pixz bubblewrap
+
+      - name: Unpack archive
+        run: tar -I pixz -xf archive.tar.xz
+
+      - name: install qpid-proton python wheel
+        run: python -m pip install 
${ProtonBuildDir}/python/pkgs/python_qpid_proton*.whl
+
+      - name: CTest
+        working-directory: ${{env.DispatchBuildDir}}
+        run: |
+          ulimit -c unlimited
+          ctest -C ${BuildType} -V -T Test --no-compress-output -I 
${{matrix.shard}},,${{matrix.shards}} -j2
+
+      - name: Upload test results
+        uses: actions/upload-artifact@v2
+        if: ${{ ! cancelled() }}
+        with:
+          name: 
Test_Results_${{matrix.os}}_${{matrix.buildType}}_${{matrix.shard}}

Review comment:
       If there are to be different runtimeCheck values these will clash. If 
there arent, maybe drop the related matrix element.

##########
File path: .github/workflows/build.yaml
##########
@@ -0,0 +1,199 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: Build
+
+on: [push, pull_request]
+
+jobs:
+  compile:
+    name: "Compile (${{matrix.os}}, ${{matrix.runtimeCheck}})"
+    runs-on: ${{ matrix.os }}
+    strategy:
+      fail-fast: false
+      matrix:
+        os: [ubuntu-20.04]
+        buildType: [RelWithDebInfo]
+        runtimeCheck: [asan]
+    env:
+      BuildType: ${{matrix.buildType}}
+      ProtonBuildDir: ${{github.workspace}}/qpid-proton/build
+      DispatchBuildDir: ${{github.workspace}}/qpid-dispatch/build
+      InstallPrefix: ${{github.workspace}}/install
+
+      ProtonCMakeExtraArgs: '-DCMAKE_C_COMPILER_LAUNCHER=ccache 
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DBUILD_BINDINGS=python 
-DRUNTIME_CHECK=${{matrix.runtimeCheck}}'
+      DispatchCMakeExtraArgs: '-DCMAKE_C_COMPILER_LAUNCHER=ccache 
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCONSOLE_INSTALL=OFF 
-DCMAKE_C_FLAGS=-DQD_MEMORY_DEBUG -DRUNTIME_CHECK=${{matrix.runtimeCheck}}'
+
+      CCACHE_BASEDIR: ${{github.workspace}}
+      CCACHE_DIR: ${{github.workspace}}/.ccache
+      CCACHE_COMPRESS: 'true'
+      CCACHE_MAXSIZE: '400MB'
+    steps:
+
+      - name: Show environment (Linux)
+        if: ${{ always() && runner.os == 'Linux' }}
+        run: env -0 | sort -z | tr '\0' '\n'
+
+      - uses: actions/checkout@v2
+        with:
+          repository: 'apache/qpid-proton'
+          ref: 'master'
+          path: 'qpid-proton'
+
+      - uses: actions/checkout@v2
+        with:
+          path: 'qpid-dispatch'
+
+      # 
https://cristianadam.eu/20200113/speeding-up-c-plus-plus-github-actions-using-ccache/
+      - name: Prepare ccache timestamp
+        id: ccache_cache_timestamp
+        shell: cmake -P {0}
+        run: |
+          string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
+          message("::set-output name=timestamp::${current_date}")
+
+      - uses: actions/cache@v2
+        env:
+          cache-name: cache-ccache
+        with:
+          path: .ccache
+          key: ${{ matrix.os }}-${{ matrix.runtimeCheck }}-${{ env.cache-name 
}}-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
+          restore-keys: |
+            ${{ matrix.os }}-${{ matrix.runtimeCheck }}-${{ env.cache-name }}
+
+      - name: Create Build and Install directories
+        run: mkdir -p "${ProtonBuildDir}" "${DispatchBuildDir}" 
"{InstallPrefix}"
+
+      - name: Setup python
+        uses: actions/setup-python@v2
+        with:
+          python-version: 3.6
+          architecture: x64
+
+      - name: Install python dependencies
+        run: python -m pip install setuptools wheel tox
+
+      - name: Install Linux dependencies
+        if: ${{ runner.os == 'Linux' }}
+        run: |
+          sudo apt install -y swig libpython3-dev libsasl2-dev libjsoncpp-dev 
libwebsockets-dev ccache ninja-build pixz
+
+      - name: Zero ccache stats
+        run: ccache -z
+
+      - name: qpid-proton cmake configure
+        working-directory: ${{env.ProtonBuildDir}}
+        run: cmake "${{github.workspace}}/qpid-proton" 
"-DCMAKE_INSTALL_PREFIX=${InstallPrefix}" "-DCMAKE_BUILD_TYPE=${BuildType}" 
"-DBUILD_TESTING=OFF" "-DENABLE_FUZZ_TESTING=OFF" "-GNinja" 
${ProtonCMakeExtraArgs}
+
+      - name: qpid-proton cmake build/install
+        run: cmake --build "${ProtonBuildDir}" --config ${BuildType} -t install
+
+      - name: Display ccache stats
+        run: ccache -s
+
+      - name: qpid-dispatch cmake configure
+        working-directory: ${{env.DispatchBuildDir}}
+        run: cmake "${{github.workspace}}/qpid-dispatch" 
"-DCMAKE_INSTALL_PREFIX=${InstallPrefix}" "-DCMAKE_BUILD_TYPE=${BuildType}" 
"-GNinja" "-DUSE_BWRAP=ON" ${DispatchCMakeExtraArgs}
+
+      - name: qpid-dispatch cmake build/install
+        run: cmake --build "${DispatchBuildDir}" --config ${BuildType} -t 
install
+
+      - name: Display ccache stats
+        run: ccache -s
+
+      # github actions/upload-artifact@v2 does not preserve executable 
permission on binaries
+      - name: Compress build
+        working-directory: ${{github.workspace}}
+        run: tar -I pixz -cf /tmp/archive.tar.xz --exclude '*.o' --exclude 
'*.pyc' --exclude '.git' --exclude='qpid-dispatch/build/console' qpid-dispatch 
install qpid-proton/build/python/pkgs
+
+      - name: Upload archive
+        uses: actions/upload-artifact@v2
+        with:
+          name: 
qpid_dispatch_wrk_${{matrix.os}}_${{matrix.buildType}}_${{matrix.runtimeCheck}}
+          path: /tmp/archive.tar.xz
+
+  test:
+    name: 'Test (${{matrix.os}}, ${{matrix.runtimeCheck}}, shard 
${{matrix.shard}} of ${{matrix.shards}})'
+    runs-on: ${{ matrix.os }}
+    needs: [compile]
+    strategy:
+      fail-fast: false
+      matrix:
+        os: [ubuntu-20.04]
+        buildType: [RelWithDebInfo]
+        runtimeCheck: [asan]
+        shard: [1, 2]
+        shards: [2]
+    env:
+      BuildType: ${{matrix.buildType}}
+      ProtonBuildDir: ${{github.workspace}}/qpid-proton/build
+      DispatchBuildDir: ${{github.workspace}}/qpid-dispatch/build
+      InstallPrefix: ${{github.workspace}}/install
+      LD_LIBRARY_PATH: ${{github.workspace}}/install/lib
+    steps:
+
+      - name: Show environment (Linux)
+        if: ${{ always() && runner.os == 'Linux' }}
+        run: env -0 | sort -z | tr '\0' '\n'
+
+      - name: Download Build
+        uses: actions/download-artifact@v2
+        with:
+          name: 
qpid_dispatch_wrk_${{matrix.os}}_${{matrix.buildType}}_${{matrix.runtimeCheck}}
+
+      - name: Setup python
+        uses: actions/setup-python@v2
+        with:
+          python-version: 3.6
+          architecture: x64
+
+      - name: Install python dependencies
+        run: python -m pip install tox
+
+      - name: Install Linux dependencies
+        if: ${{ runner.os == 'Linux' }}
+        run: |
+          sudo apt install -y libsasl2-2 libsasl2-modules sasl2-bin 
libjsoncpp1 libwebsockets15 pixz bubblewrap
+
+      - name: Unpack archive
+        run: tar -I pixz -xf archive.tar.xz
+
+      - name: install qpid-proton python wheel
+        run: python -m pip install 
${ProtonBuildDir}/python/pkgs/python_qpid_proton*.whl
+
+      - name: CTest
+        working-directory: ${{env.DispatchBuildDir}}
+        run: |
+          ulimit -c unlimited
+          ctest -C ${BuildType} -V -T Test --no-compress-output -I 
${{matrix.shard}},,${{matrix.shards}} -j2
+
+      - name: Upload test results
+        uses: actions/upload-artifact@v2
+        if: ${{ ! cancelled() }}
+        with:
+          name: 
Test_Results_${{matrix.os}}_${{matrix.buildType}}_${{matrix.shard}}
+          path: ${{env.DispatchBuildDir}}/Testing/**/*.xml
+
+      - name: Upload core files (if any)
+        uses: actions/upload-artifact@v2
+        if: failure()
+        with:
+          name: cores_${{matrix.os}}_${{matrix.buildType}}_${{matrix.shard}}

Review comment:
       Ditto.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


> Use GitHub Actions w/ sharding and bubblewrap for some fast CI
> --------------------------------------------------------------
>
>                 Key: DISPATCH-1739
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-1739
>             Project: Qpid Dispatch
>          Issue Type: Improvement
>          Components: Tests
>    Affects Versions: 1.12.0
>            Reporter: Jiri Daněk
>            Assignee: Jiri Daněk
>            Priority: Major
>             Fix For: 1.13.0
>
>
> GitHub Actions is a task runner associated with a GitHub project. It is 
> conceptually similar to Travis, except that it has some extra features, and 
> the waits for computational resources are much shorter (currently).
> Sharding is a technique to speed up the execution of tests. Instead of 
> running the tests on one machine one after another, copy the build directory 
> over to multiple machines, say two, and have the first execute the 
> odd-numbered and the second one the even-numbered tests. With luck (if 
> copying the build directory is relatively fast, and the tests all take 
> approximately the same time), this will cut the execution time in half.
> Bubblewrap (https://github.com/containers/bubblewrap) is a sandboxing tool 
> available on Ubuntu and other systems. It is similar to systemd-nspawn except 
> it does not require sudo or user namespace support in the kernel. It is 
> similar to docker, except it does not use images, instead it selectively 
> mounts directories from the host. Bubblewrap can create an isolated network 
> namespace, which allows running multiple tests at the same time, each in its 
> own bubblewrap sandbox, and they don't clash on ports. With bubblewrap, 
> running {{ctest -j4}} is safe.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to