Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
CWillberg committed Mar 21, 2024
2 parents b786a2c + 06055a8 commit dd663a4
Show file tree
Hide file tree
Showing 28 changed files with 400 additions and 237 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# SPDX-FileCopyrightText: 2023 Christian Willberg <christian.willberg@dlr.de>, Jan-Timo Hesse <jan-timo.hesse@dlr.de>
#
# SPDX-License-Identifier: BSD-3-Clause

name: PeriLab CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
workflow_dispatch:
push:
paths:
- "src/**"
branches:
- main
pull_request:
paths:
- "src/**"
branches-ignore:
- release

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 50

strategy:
# Without setting this, a failing test cancels all others
fail-fast: false
matrix:
# We test quite a lot of versions because we do some OS and version specific things unfortunately
julia-version: ["1.10"] # "~1.12.0-0"]
os: [ubuntu-latest]

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

# Makes the `julia` command available
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia-version }}
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: PeriHub/PeriLab.jl
files: lcov.info
49 changes: 49 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# SPDX-FileCopyrightText: 2023 Christian Willberg <christian.willberg@dlr.de>, Jan-Timo Hesse <jan-timo.hesse@dlr.de>
#
# SPDX-License-Identifier: BSD-3-Clause

name: CompatHelper
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Check if Julia is already available in the PATH
id: julia_in_path
run: which julia
continue-on-error: true
- name: Install Julia, but only if it is not already available in the PATH
uses: julia-actions/setup-julia@v1
with:
version: "1"
arch: ${{ runner.arch }}
if: steps.julia_in_path.outcome != 'success'
- name: "Add the General registry via Git"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: "Install CompatHelper"
run: |
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: "Run CompatHelper"
run: |
import CompatHelper
CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
35 changes: 35 additions & 0 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# SPDX-FileCopyrightText: 2023 Christian Willberg <christian.willberg@dlr.de>, Jan-Timo Hesse <jan-timo.hesse@dlr.de>
#
# SPDX-License-Identifier: BSD-3-Clause

name: Documentation

on:
push:
paths:
- "src/**"
- "docs/**"
branches:
- main
tags: "*"
pull_request:

jobs:
build:
permissions:
contents: write
statuses: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: "1.10"
- uses: julia-actions/cache@v1
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key
run: julia --project=docs/ docs/make.jl
59 changes: 59 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# SPDX-FileCopyrightText: 2023 Christian Willberg <christian.willberg@dlr.de>, Jan-Timo Hesse <jan-timo.hesse@dlr.de>
#
# SPDX-License-Identifier: BSD-3-Clause

name: TagBot
on:
issue_comment:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: 3
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Edit the following line to reflect the actual name of the GitHub Secret containing your private key
ssh: ${{ secrets.DOCUMENTER_KEY }}
# ssh: ${{ secrets.NAME_OF_MY_SSH_PRIVATE_KEY_SECRET }}
DockerHub:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get version from Project.toml
id: get_version
run: echo "::set-output name=version::$(awk -F'"' '/version/{print $2}' Project.toml)"
- name: Build Docker image
run: docker build -t perihub/perilab:${{ steps.get_version.outputs.version }} .
- name: Publish to Registry
run: docker push perihub/perilab${{ steps.get_version.outputs.version }}
- name: Retag latest
run: docker tag perihub/perilab${{ steps.get_version.outputs.version }} perihub/perilab:latest
- name: Publish to Registry
run: docker push perihub/perilab:latest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ LocalPreferences.toml
test/tryout/
examples/dev/
LocalPreferences.toml
.env
109 changes: 0 additions & 109 deletions .gitlab-ci.yml

This file was deleted.

18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,23 @@ SPDX-License-Identifier: BSD-3-Clause

All notable changes to this project will be documented in this file.

## [1.0.7] - 2024-
## [1.1.1] - 2024-

### Changed

## [1.1.0] - 2024-03-19

### Changed

- Julia version

### Fixed

- MPI Issue
- Logging


## [1.0.7] - 2024-03-12

### Added

Expand Down
20 changes: 10 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@ COPY Project.toml ./Project.toml

# Install build dependencies
RUN apt-get update \
&& apt-get install -yq build-essential openssh-server \
&& julia --project=@. -e 'import Pkg; Pkg.add(url="https://github.com/JTHesse/AbaqusReader.jl"); Pkg.add("PackageCompiler"); using PackageCompiler; create_app(".", "build", executables=["PeriLab" => "main", "get_examples" => "get_examples"], incremental=true, force=true)'
&& apt-get install -yq build-essential\
&& julia --project=@. -e 'import Pkg; Pkg.add(url="https://github.com/JTHesse/AbaqusReader.jl"); Pkg.add("PackageCompiler")'

RUN julia --project=@. -e 'using PackageCompiler; create_app(".", "build", executables=["PeriLab" => "main", "get_examples" => "get_examples"], force=true)'

#TODO: use alpine
FROM julia:latest as main
FROM debian:bookworm-slim as main

WORKDIR /app

# Create the destination directory
RUN mkdir PeriLab

# Assuming /env/build is the build directory from previous stages
COPY --from=build /env/build /app/PeriLab

# Move the build folder, set permissions, and delete the rest
Expand All @@ -30,13 +34,9 @@ RUN chmod +x /app/PeriLab/bin/PeriLab \

ENV PATH="/app/PeriLab/bin:${PATH}"

# RUN apk update && apk add bash && apk add openssh
# Install SSH server and other dependencies
RUN apt-get update && apt-get install -yq openssh-server

# Allow mpirun as root, should only be used in container
ENV OMPI_ALLOW_RUN_AS_ROOT 1
ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM 1

# Configure SSH server
RUN mkdir /var/run/sshd \
&& echo 'root:root' | chpasswd \
Expand All @@ -46,8 +46,8 @@ RUN mkdir /var/run/sshd \
&& sed -i'' -e's/^UsePAM yes/UsePAM no/' /etc/ssh/sshd_config

# Start SSH service
RUN service ssh start
CMD ["/usr/sbin/sshd", "-D"]

# Expose SSH port
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]

2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PeriLab"
uuid = "2ecefcea-59f0-46dd-9cfd-1d2b8cc5f112"
authors = ["Christian Willberg <christian.willberg@dlr.de>", "Jan-Timo Hesse <jan-timo.hesse@dlr.de>"]
version = "1.0.7"
version = "1.1.1"

[deps]
AbaqusReader = "bc6b9049-e460-56d6-94b4-a597b2c0390d"
Expand Down
Loading

0 comments on commit dd663a4

Please sign in to comment.