Skip to content

Commit

Permalink
Merge branch 'main' into create-installer
Browse files Browse the repository at this point in the history
  • Loading branch information
jfantinhardesty committed Aug 5, 2024
2 parents 31ed31d + 8f91a76 commit e222b87
Show file tree
Hide file tree
Showing 6 changed files with 155 additions and 37 deletions.
44 changes: 36 additions & 8 deletions .github/workflows/cmake-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,42 +33,70 @@ jobs:
- os: ubuntu-24.04
c_compiler: gcc
cpp_compiler: g++
arm_c_compiler: aarch64-linux-gnu-gcc
arm_cpp_compiler: aarch64-linux-gnu-g++
- os: ubuntu-24.04
c_compiler: clang
cpp_compiler: clang++
arm_c_compiler: clang
arm_cpp_compiler: clang++
- os: ubuntu-22.04
c_compiler: gcc
cpp_compiler: g++
arm_c_compiler: aarch64-linux-gnu-gcc
arm_cpp_compiler: aarch64-linux-gnu-g++
- os: ubuntu-22.04
c_compiler: clang
cpp_compiler: clang++
arm_c_compiler: clang
arm_cpp_compiler: clang++
- os: ubuntu-20.04
c_compiler: gcc
cpp_compiler: g++
arm_c_compiler: aarch64-linux-gnu-gcc
arm_cpp_compiler: aarch64-linux-gnu-g++
- os: ubuntu-20.04
c_compiler: clang
cpp_compiler: clang++
arm_c_compiler: aarch64-linux-gnu-gcc
arm_cpp_compiler: aarch64-linux-gnu-g++
- os: windows-latest

steps:
- uses: actions/checkout@v4

- name: Build using CMake on Linux
- name: Install cross compiler
if: ${{ Contains(matrix.os, 'ubuntu') }}
run: >
./build_samples.sh
--no-tests
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
run: |
sudo apt-get update
sudo apt-get install -y g++-aarch64-linux-gnu gcc-aarch64-linux-gnu libstdc++6-arm64-cross linux-libc-dev-arm64-cross
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
if: ${{ Contains(matrix.os, 'windows') }}
id: runvcpkg
with:
# The vcpkg.json file, which will be part of cache key computation.
vcpkgJsonGlob: '**/src/vcpkg.json'

- name: Build using CMake on Linux for amd64
if: ${{ Contains(matrix.os, 'ubuntu') }}
run: >
./build_samples_x64.sh
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
- name: Cleanup Build
if: ${{ Contains(matrix.os, 'ubuntu') }}
run: >
rm -r ../nx-lyve-cloud-plugin-build/
- name: Build using CMake on Linux for arm64
if: ${{ Contains(matrix.os, 'ubuntu') }}
run: >
./build_samples_arm64.sh
-DCMAKE_CXX_COMPILER=${{ matrix.arm_cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.arm_c_compiler }}
- name: Build using CMake on Windows
shell: powershell
if: ${{ Contains(matrix.os, 'windows') }}
Expand Down
102 changes: 76 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,36 @@ jobs:
- os: ubuntu-24.04
c_compiler: gcc
cpp_compiler: g++
arm_c_compiler: aarch64-linux-gnu-gcc
arm_cpp_compiler: aarch64-linux-gnu-g++
- os: ubuntu-22.04
c_compiler: gcc
cpp_compiler: g++
arm_c_compiler: aarch64-linux-gnu-gcc
arm_cpp_compiler: aarch64-linux-gnu-g++
- os: ubuntu-20.04
c_compiler: gcc
cpp_compiler: g++
arm_c_compiler: aarch64-linux-gnu-gcc
arm_cpp_compiler: aarch64-linux-gnu-g++
- os: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run build script for Linux
- name: Install cross compiler
if: ${{ Contains(matrix.os, 'ubuntu') }}
run: >
./build_samples.sh
--no-tests
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
run: |
sudo apt-get update
sudo apt-get install -y g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
if: ${{ Contains(matrix.os, 'windows') }}
id: runvcpkg
with:
# The vcpkg.json file, which will be part of cache key computation.
vcpkgJsonGlob: '**/src/vcpkg.json'

- name: Run build script for Windows
shell: powershell
if: ${{ Contains(matrix.os, 'windows') }}
run: >
.\build_samples.bat
--no-tests
- name: Download cloudfuse for Windows
if: ${{ Contains(matrix.os, 'windows') }}
shell: pwsh
Expand All @@ -56,20 +52,63 @@ jobs:
$file_name = $download_url.Split('/')[-1]
Invoke-WebRequest -Uri $download_url -OutFile $file_name
- name: Download cloudfuse for Linux (no_gui)
- name: Download cloudfuse for Linux amd64 (no_gui)
if: ${{ Contains(matrix.os, 'ubuntu') }}
run: |
download_url=$(curl -s https://api.github.com/repos/Seagate/cloudfuse/releases/latest | jq -r '.assets[] | select(.name | contains("linux_amd64.deb")) | .browser_download_url')
curl -LO $download_url
- name: Download cloudfuse for Linux arm64 (no_gui)
if: ${{ Contains(matrix.os, 'ubuntu') }}
run: |
download_url=$(curl -s https://api.github.com/repos/Seagate/cloudfuse/releases/latest | jq -r '.assets[] | select(.name | contains("linux_arm64.deb")) | .browser_download_url')
curl -LO $download_url
- name: Package Artifacts Linux
- name: Run build script for Linux x64
if: ${{ Contains(matrix.os, 'ubuntu') }}
run: >
./build_samples_x64.sh
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
- name: Package Artifacts Linux x64
if: ${{ Contains(matrix.os, 'ubuntu') }}
run: |
mkdir nx-lyve-cloud-plugin-${{ matrix.os }}
mv ../nx-lyve-cloud-plugin-build/cloudfuse_plugin/*.so nx-lyve-cloud-plugin-${{ matrix.os }}/cloudfuse_plugin.so
mv ./install_plugin_linux.sh nx-lyve-cloud-plugin-${{ matrix.os }}/
mkdir nx-lyve-cloud-plugin-${{ matrix.os }}_x64
mv ../nx-lyve-cloud-plugin-build/cloudfuse_plugin/*.so nx-lyve-cloud-plugin-${{ matrix.os }}_x64/cloudfuse_plugin.so
mv ./cloudfuse*_linux_amd64.deb nx-lyve-cloud-plugin-${{ matrix.os }}/
zip -r nx-lyve-cloud-plugin-${{ matrix.os }}.zip nx-lyve-cloud-plugin-${{ matrix.os }}
cp ./install_plugin_linux.sh nx-lyve-cloud-plugin-${{ matrix.os }}_x64/
cp ./setup_fuse_allow_other.sh nx-lyve-cloud-plugin-${{ matrix.os }}_x64/
zip -r nx-lyve-cloud-plugin-${{ matrix.os }}_x64.zip nx-lyve-cloud-plugin-${{ matrix.os }}_x64
- name: Cleanup Build
if: ${{ Contains(matrix.os, 'ubuntu') }}
run: >
rm -r ../nx-lyve-cloud-plugin-build/
- name: Run build script for Linux arm64
if: ${{ Contains(matrix.os, 'ubuntu') }}
run: >
./build_samples_arm64.sh
-DCMAKE_CXX_COMPILER=${{ matrix.arm_cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.arm_c_compiler }}
- name: Package Artifacts Linux arm64
if: ${{ Contains(matrix.os, 'ubuntu') }}
run: |
mkdir nx-lyve-cloud-plugin-${{ matrix.os }}_arm64
mv ../nx-lyve-cloud-plugin-build/cloudfuse_plugin/*.so nx-lyve-cloud-plugin-${{ matrix.os }}_arm64/cloudfuse_plugin.so
mv ./cloudfuse*_linux_arm64.deb nx-lyve-cloud-plugin-${{ matrix.os }}/
cp ./install_plugin_linux.sh nx-lyve-cloud-plugin-${{ matrix.os }}_arm64/
cp ./setup_fuse_allow_other.sh nx-lyve-cloud-plugin-${{ matrix.os }}_arm64/
zip -r nx-lyve-cloud-plugin-${{ matrix.os }}_arm64.zip nx-lyve-cloud-plugin-${{ matrix.os }}_arm64
- name: Run build script for Windows
shell: powershell
if: ${{ Contains(matrix.os, 'windows') }}
run: >
.\build_samples.bat
--no-tests
- name: Package Artifacts Windows
shell: powershell
Expand All @@ -81,12 +120,20 @@ jobs:
mv .\cloudfuse*_windows_amd64.deb nx-lyve-cloud-plugin-windows\
Compress-Archive nx-lyve-cloud-plugin-windows nx-lyve-cloud-plugin-windows.zip
- name: Archive production artifacts from Ubuntu
- name: Archive production artifacts from Ubuntu x64
if: ${{ Contains(matrix.os, 'ubuntu') }}
uses: actions/upload-artifact@v4
with:
name: nx-lyve-cloud-plugin-${{ matrix.os }}_x64
path: nx-lyve-cloud-plugin-${{ matrix.os }}_x64.zip
if-no-files-found: error

- name: Archive production artifacts from Ubuntu arm64
if: ${{ Contains(matrix.os, 'ubuntu') }}
uses: actions/upload-artifact@v4
with:
name: nx-lyve-cloud-plugin-${{ matrix.os }}
path: nx-lyve-cloud-plugin-${{ matrix.os }}.zip
name: nx-lyve-cloud-plugin-${{ matrix.os }}_arm64
path: nx-lyve-cloud-plugin-${{ matrix.os }}_arm64.zip
if-no-files-found: error

- name: Archive production artifacts from Windows
Expand All @@ -111,7 +158,10 @@ jobs:
uses: softprops/action-gh-release@v2
with:
files: |
nx-lyve-cloud-plugin-ubuntu-24.04/*
nx-lyve-cloud-plugin-ubuntu-22.04/*
nx-lyve-cloud-plugin-ubuntu-20.04/*
nx-lyve-cloud-plugin-ubuntu-24.04_x64/*
nx-lyve-cloud-plugin-ubuntu-22.04_x64/*
nx-lyve-cloud-plugin-ubuntu-20.04_x64/*
nx-lyve-cloud-plugin-ubuntu-24.04_arm64/*
nx-lyve-cloud-plugin-ubuntu-22.04_arm64/*
nx-lyve-cloud-plugin-ubuntu-20.04_arm64/*
nx-lyve-cloud-plugin-windows/*
3 changes: 2 additions & 1 deletion build_samples_arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ set -x #< Log each command.

"$BASE_DIR"/build_samples.sh \
--no-tests \
-DCMAKE_TOOLCHAIN_FILE=$BASE_DIR/toolchain_arm64.cmake \
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT"/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=arm64-linux \
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE="$BASE_DIR/toolchain_arm64.cmake" \
"$@"
17 changes: 17 additions & 0 deletions build_samples_x64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

## Copyright © 2024 Seagate Technology LLC and/or its Affiliates
## Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/

set -e #< Exit on error.
set -u #< Prohibit undefined variables.

BASE_DIR=$(readlink -f "$(dirname "$0")") #< Absolute path to the current dir.

set -x #< Log each command.

"$BASE_DIR"/build_samples.sh \
--no-tests \
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT"/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-linux \
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE="$BASE_DIR/toolchain_x64.cmake" \
"$@"
16 changes: 14 additions & 2 deletions toolchain_arm64.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
## Copyright © 2024 Seagate Technology LLC and/or its Affiliates
## Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/

set(CMAKE_C_COMPILER "/usr/bin/aarch64-linux-gnu-gcc")
set(CMAKE_CXX_COMPILER "/usr/bin/aarch64-linux-gnu-g++")
# Clang supports cross compiling, but needs to specify the target to compile to
if(CMAKE_C_COMPILER MATCHES "clang")
set(CMAKE_C_FLAGS "--target=aarch64-linux-gnu")
set(CMAKE_CXX_FLAGS "--target=aarch64-linux-gnu")
endif()

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_CROSSCOMPILING TRUE)

set(VCPKG_TARGET_ARCHITECTURE arm64)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)

# This is required by FindThreads CMake module.
set(THREADS_PTHREAD_ARG "2" CACHE STRING "" FORCE)
Expand Down
10 changes: 10 additions & 0 deletions toolchain_x64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Copyright © 2024 Seagate Technology LLC and/or its Affiliates
## Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR AMD64)

set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)

0 comments on commit e222b87

Please sign in to comment.