Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy to scijava #84

Merged
merged 61 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
7f11871
add license file
carlosuc3m Sep 2, 2024
0adc57c
add license headers
carlosuc3m Sep 2, 2024
f1510fc
correct small dertails of pom and prepare it for scijava deploy
carlosuc3m Sep 2, 2024
f66876f
add required contributors to the pom.xml
carlosuc3m Sep 2, 2024
9b6114f
upload artifacts from different os
carlosuc3m Sep 2, 2024
3535189
create the action that puts together all teh native files
carlosuc3m Sep 2, 2024
7a237e6
silly error and do not test always, only on main
carlosuc3m Sep 2, 2024
1dc030e
owner cannot be a role
carlosuc3m Sep 2, 2024
e36d7fb
add shell bash to run it on every platform
carlosuc3m Sep 2, 2024
7c5df78
do one test
carlosuc3m Sep 2, 2024
d8ab0f8
fix error refererencing github variables
carlosuc3m Sep 2, 2024
723390c
add double bracket when needed
carlosuc3m Sep 2, 2024
032bc26
test
carlosuc3m Sep 2, 2024
e694c12
correct artifacts dir names
carlosuc3m Sep 2, 2024
57d1de4
is ubunut not linux
carlosuc3m Sep 2, 2024
d83d523
correct paths
carlosuc3m Sep 2, 2024
8fd92cf
upgrade actions to avoid warnings
carlosuc3m Sep 2, 2024
9fe9a2d
change deprecated
carlosuc3m Sep 2, 2024
1ce2fd5
CHANGE IN BUILD.YAML TO MAKE IT COMPATIBLE WITH SCIJAVA-SCRIPTS
carlosuc3m Sep 4, 2024
bcff44c
delete incorrectly added zip
carlosuc3m Sep 4, 2024
feacf05
try removing plugin
carlosuc3m Sep 4, 2024
f747685
try
carlosuc3m Sep 4, 2024
51207b1
come back to arm64
carlosuc3m Sep 4, 2024
d677bc4
update the version of the native library being pulled
carlosuc3m Sep 9, 2024
3307ce8
check if running works on intel mac
carlosuc3m Sep 11, 2024
ee89ef8
understand what is happening
carlosuc3m Sep 11, 2024
8b0896c
correct syntax
carlosuc3m Sep 11, 2024
6b7217c
try
carlosuc3m Sep 11, 2024
c7aeec4
come back to original
carlosuc3m Sep 11, 2024
39aad39
remove macos intel
carlosuc3m Sep 11, 2024
0fe7969
remove macos m1 for speed
carlosuc3m Sep 11, 2024
6c1bd04
remove comment
carlosuc3m Sep 11, 2024
2873e29
stupid error
carlosuc3m Sep 11, 2024
100a1c2
understand what is happening
carlosuc3m Sep 11, 2024
4ef91e6
forgot to comment
carlosuc3m Sep 11, 2024
ec7877b
understand decompressed
carlosuc3m Sep 11, 2024
4a1f680
check what is happening
carlosuc3m Sep 11, 2024
8262875
verbose extraction
carlosuc3m Sep 11, 2024
4c96c88
correct the extraction of libraries from the jar
carlosuc3m Sep 11, 2024
d5c3364
correct mvn from one dir to another
carlosuc3m Sep 11, 2024
ffd8abb
do it for every os
carlosuc3m Sep 11, 2024
929b333
correct the folder where the macosx-arm64 is when extracting
carlosuc3m Sep 12, 2024
220dc37
actionify repo for deployment
carlosuc3m Oct 17, 2024
6f9ef21
correct the yaml
carlosuc3m Oct 17, 2024
1d621ad
change character
carlosuc3m Oct 17, 2024
bc7b27e
easy test for ubuntu and mac only (fast)
carlosuc3m Oct 17, 2024
d79c863
remove other components for quick test
carlosuc3m Oct 17, 2024
f5a6a0c
come back to full deployment action
carlosuc3m Oct 17, 2024
be4cca8
Merge remote-tracking branch 'origin/main' into deploy-to-scijava
carlosuc3m Oct 17, 2024
c5e8808
correct imports
carlosuc3m Oct 17, 2024
649889c
Merge remote-tracking branch 'origin/remove-see-tag' into deploy-to-s…
carlosuc3m Oct 17, 2024
731d09e
try again fast example
carlosuc3m Oct 17, 2024
89b7a9b
come back to full CI
carlosuc3m Oct 17, 2024
af881e6
Merge remote-tracking branch 'origin/javadoc-fix' into deploy-to-scijava
carlosuc3m Oct 17, 2024
922a6ad
quick test
carlosuc3m Oct 17, 2024
425f060
remove not used params
carlosuc3m Oct 17, 2024
ab3b741
rename workgflow and be ignored
carlosuc3m Oct 17, 2024
6098a23
chcks if secrets are set
carlosuc3m Oct 17, 2024
4026277
correct malconfiguration of yaml
carlosuc3m Oct 17, 2024
29f81cd
try to see if changin the os affects
carlosuc3m Oct 17, 2024
bb1b425
os does not affect
carlosuc3m Oct 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/main/ci-build.sh
sh ci-build.sh
3 changes: 3 additions & 0 deletions .github/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/main/ci-setup-github-actions.sh
sh ci-setup-github-actions.sh
199 changes: 139 additions & 60 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,85 +1,164 @@
---
name: build

on:
push:
branches: [ main ]
branches:
- main
- deploy-to-scijava
tags:
- "*-[0-9]+.*"
paths-ignore:
- .github/workflows/build_fast.yaml
pull_request:
branches: [ main ]


branches:
- main
env:
opencl-icd-loader-git-tag: "v2023.04.17"
opencl-headers-git-tag: "v2023.04.17"

opencl-icd-loader-git-tag: v2023.04.17
opencl-headers-git-tag: v2023.04.17
jobs:
build:
build-os:
strategy:
fail-fast: false
matrix:
name: [ubuntu, windows, macos]
name:
- ubuntu
- windows
- macos
include:
- name: ubuntu
os: ubuntu-latest
c-compiler: "gcc"
cxx-compiler: "g++"
cmake-build-type: "Release"
c-compiler: gcc
cxx-compiler: g++
cmake-build-type: Release
cmake-build-flag: ""
- name: windows
os: windows-latest
c-compiler: "cl.exe"
cxx-compiler: "cl.exe"
cmake-build-type: "Release"
cmake-build-flag: "-A x64"
c-compiler: cl.exe
cxx-compiler: cl.exe
cmake-build-type: Release
cmake-build-flag: -A x64
- name: macos
os: macos-13
c-compiler: "clang"
cxx-compiler: "clang++"
cmake-build-type: "Release"
os: macos-14
c-compiler: clang
cxx-compiler: clang++
cmake-build-type: Release
cmake-build-flag: ""
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: ilammy/msvc-dev-cmd@v1
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: "11"
distribution: adopt
- name: Install ocl-icd-loader - windows
if: runner.os == 'Windows'
run: |
cd ..

- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
git clone --branch ${{ env.opencl-icd-loader-git-tag }} https://github.com/KhronosGroup/OpenCL-ICD-Loader

- name: Install ocl-icd-loader - windows
if: runner.os == 'Windows'
run: |
cd ..
git clone --branch ${{ env.opencl-icd-loader-git-tag }} https://github.com/KhronosGroup/OpenCL-ICD-Loader
git clone --branch ${{ env.opencl-headers-git-tag }} https://github.com/KhronosGroup/OpenCL-Headers
cmake -S "./OpenCL-Headers" -B "./OpenCL-Headers/build"
cmake --build "./OpenCL-Headers/build" --parallel 6 --target install
cmake -D CMAKE_PREFIX_PATH="./OpenCL-Headers" -D OPENCL_ICD_LOADER_HEADERS_DIR="./OpenCL-Headers/" -S "./OpenCL-ICD-Loader" -B "./OpenCL-ICD-Loader/build" -A x64
cmake --build "./OpenCL-ICD-Loader/build" --parallel 6 --target install --config Release
shell: bash -l {0}
git clone --branch ${{ env.opencl-headers-git-tag }} https://github.com/KhronosGroup/OpenCL-Headers

cmake -S "./OpenCL-Headers" -B "./OpenCL-Headers/build"

cmake --build "./OpenCL-Headers/build" --parallel 6 --target install

cmake -D CMAKE_PREFIX_PATH="./OpenCL-Headers" -D OPENCL_ICD_LOADER_HEADERS_DIR="./OpenCL-Headers/" -S "./OpenCL-ICD-Loader" -B "./OpenCL-ICD-Loader/build" -A x64

cmake --build "./OpenCL-ICD-Loader/build" --parallel 6 --target install --config Release
shell: bash -l {0}
- name: Increase swapfile on Ubuntu
if: runner.os == 'Linux'
run: |
sudo swapoff -a
sudo fallocate -l 15G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
- name: Install openCL on Ubuntu
if: runner.os == 'Linux'
run: sudo apt install ocl-icd-opencl-dev
- name: Build with Maven
run: mvn clean install -DskipTests
shell: bash
- name: Run Java class (only possible on MacOS intel)
if: contains(matrix.os, 'macos')
run: >
if [[ $(uname -m) == 'x86_64' ]]; then
mvn dependency:build-classpath -Dmdep.outputFile=classpath.txt
java -cp target/classes:$(cat classpath.txt) net.clesperanto.ClesperantoJ
fi
- name: Get Maven Version and Upload Artifact
shell: bash
run: |
MVN_VERSION=$(mvn -q \
-Dexec.executable=echo \
-Dexec.args='${project.version}' \
--non-recursive \
exec:exec)
MVN_NAME=$(mvn -q \
-Dexec.executable=echo \
-Dexec.args='${project.name}' \
--non-recursive \
exec:exec)
echo "version=${MVN_VERSION}" >> $GITHUB_OUTPUT
echo "name=${MVN_NAME}" >> $GITHUB_OUTPUT
id: mvn_info
- name: Upload native library
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}-artifact
path: target/${{steps.mvn_info.outputs.name}}-${{steps.mvn_info.outputs.version}}.jar
build:
needs: build-os
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: "8"
distribution: zulu
cache: maven
- name: Download all platform-specific JAR files
uses: actions/download-artifact@v4
- name: Get Maven Version
run: |
MVN_VERSION=$(mvn -q \
-Dexec.executable=echo \
-Dexec.args='${project.version}' \
--non-recursive \
exec:exec)
MVN_NAME=$(mvn -q \
-Dexec.executable=echo \
-Dexec.args='${project.name}' \
--non-recursive \
exec:exec)
echo "version=${MVN_VERSION}" >> $GITHUB_OUTPUT
echo "name=${MVN_NAME}" >> $GITHUB_OUTPUT
id: mvn_info
- name: Extract compiled native libraries to target fodler libs
run: |
jar xf ubuntu-artifact/${{steps.mvn_info.outputs.name}}-${{steps.mvn_info.outputs.version}}.jar net/clesperanto/linux-x86_64

- name: Increase swapfile on Ubuntu
if: runner.os == 'Linux'
run: |
sudo swapoff -a
sudo fallocate -l 15G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
jar xf windows-artifact/${{steps.mvn_info.outputs.name}}-${{steps.mvn_info.outputs.version}}.jar net/clesperanto/windows-x86_64

- name: Install openCL on Ubuntu
if: runner.os == 'Linux'
run: sudo apt install ocl-icd-opencl-dev
jar xf macos-artifact/${{steps.mvn_info.outputs.name}}-${{steps.mvn_info.outputs.version}}.jar net/clesperanto/macosx-arm64

- name: Build with Maven
run: mvn clean install -DskipTests
shell: bash
mkdir -p libs

- name: Run Java class (only possible on MacOS)
if: contains(matrix.os, 'macos')
run: |
mvn dependency:build-classpath -Dmdep.outputFile=classpath.txt
java -cp target/classes:$(cat classpath.txt) net.clesperanto.ClesperantoJ
mv net/clesperanto/* libs/
- name: Set up CI environment
run: .github/setup.sh
- name: Execute the build
run: .github/build.sh
env:
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
OSSRH_PASS: ${{ secrets.OSSRH_PASS }}
SIGNING_ASC: ${{ secrets.SIGNING_ASC }}
44 changes: 44 additions & 0 deletions .github/workflows/build_fast.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: build fast
on:
push:
branches:
- main
- deploy-to-scijava
tags:
- "*-[0-9]+.*"
pull_request:
branches:
- main
env:
opencl-icd-loader-git-tag: v2023.04.17
opencl-headers-git-tag: v2023.04.17
jobs:
build:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: "8"
distribution: zulu
cache: maven
- name: Check secrets are set
run: |
if [ -z "$GPG_KEY_NAME" ]; then echo "GPG_KEY_NAME is not set"; fi
if [ -z "$GPG_PASSPHRASE" ]; then echo "GPG_PASSPHRASE is not set"; fi
if [ -z "$MAVEN_USER" ]; then echo "MAVEN_USER is not set"; fi
if [ -z "$MAVEN_PASS" ]; then echo "MAVEN_PASS is not set"; fi
if [ -z "$OSSRH_PASS" ]; then echo "OSSRH_PASS is not set"; fi
if [ -z "$SIGNING_ASC" ]; then echo "SIGNING_ASC is not set"; fi
- name: Set up CI environment
run: .github/setup.sh
- name: Execute the build
run: .github/build.sh
env:
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
OSSRH_PASS: ${{ secrets.OSSRH_PASS }}
SIGNING_ASC: ${{ secrets.SIGNING_ASC }}
6 changes: 5 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: ClesperantoJ tests

on: [push]
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
Expand Down
27 changes: 27 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright 2024 Stéphane Rigaud, Robert Haase, Institut Pasteur Paris, Max Planck Institute for Molecular Cell Biology and Genetics Dresden, ScaDS.AI, Leipzig University

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
<url>https://github.com/clEsperanto/clesperantoj_prototype/actions</url>
</ciManagement>



<profiles>
<profile>
Expand Down
33 changes: 33 additions & 0 deletions src/main/java/net/clesperanto/ClesperantoJ.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@

/*
* Copyright 2024 Stéphane Rigaud, Robert Haase, Institut Pasteur Paris,
* Max Planck Institute for Molecular Cell Biology and Genetics Dresden,
* ScaDS.AI, Leipzig University
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

package net.clesperanto;

import net.clesperanto.core.*;
Expand Down
32 changes: 32 additions & 0 deletions src/main/java/net/clesperanto/ImagePlusClesperantoJExample.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
/*
* Copyright 2024 Stéphane Rigaud, Robert Haase, Institut Pasteur Paris,
* Max Planck Institute for Molecular Cell Biology and Genetics Dresden,
* ScaDS.AI, Leipzig University
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

package net.clesperanto;

import ij.IJ;
Expand Down
Loading
Loading