Skip to content

Commit

Permalink
Merge pull request #15 from arcaneframework/dev/al-readme-update
Browse files Browse the repository at this point in the history
Update readme
  • Loading branch information
AlexlHer authored Dec 19, 2022
2 parents c409642 + bd39dae commit 1b1635c
Show file tree
Hide file tree
Showing 4 changed files with 181 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN cd /tmp \
-D CMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@ \
-D ARCCORE_BUILD_MODE=@ARCCORE_BUILD_MODE@ \
-D ARCANE_BUILD_TYPE=@ARCANE_BUILD_TYPE@ \
@ADDED_CMAKE@ \
@CMAKE_CONFIG@ \
&& cmake --build /tmp/build --target install \
&& cd / && rm -rf /tmp/*

Expand Down
10 changes: 5 additions & 5 deletions .github/scripts/DockerfileGenerator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CXX_COMPILER=''
CMAKE_BUILD_TYPE=''
ARCCORE_BUILD_MODE=''
ARCANE_BUILD_TYPE=''
ADDED_CMAKE=''
CMAKE_CONFIG=''


# Fonction permettant d'afficher l'aide.
Expand Down Expand Up @@ -247,11 +247,11 @@ then

elif [ "$IMAGE_VERSION" = 'full' ]
then
ADDED_CMAKE+='-D PTScotch_INCLUDE_DIR="/usr/include/scotch" '
CMAKE_CONFIG+='-D PTScotch_INCLUDE_DIR="/usr/include/scotch" '

elif [ "$IMAGE_VERSION" = 'minimal' ] || [ "$IMAGE_VERSION" = 'doc' ]
then
ADDED_CMAKE+=''
CMAKE_CONFIG+=''

else
echo "Unknown image version: $IMAGE_VERSION"
Expand All @@ -275,7 +275,7 @@ echo "CXX_COMPILER= $CXX_COMPILER"
echo "CMAKE_BUILD_TYPE= $CMAKE_BUILD_TYPE"
echo "ARCCORE_BUILD_MODE= $ARCCORE_BUILD_MODE"
echo "ARCANE_BUILD_TYPE= $ARCANE_BUILD_TYPE"
echo "ADDED_CMAKE= $ADDED_CMAKE"
echo "CMAKE_CONFIG= $CMAKE_CONFIG"
echo ""
echo "IMAGE_BASE= $OS"":""$COMPILER_NAME$COMPILER_VERSION_WITH_DASH""_""$IMAGE_VERSION""_latest"
echo "DOCKERFILE.IN= $DFIN"
Expand All @@ -297,7 +297,7 @@ s:@BASE_IMAGE_DATE@:$BASE_IMAGE_DATE:g; \
s:@CMAKE_BUILD_TYPE@:$CMAKE_BUILD_TYPE:g; \
s:@ARCCORE_BUILD_MODE@:$ARCCORE_BUILD_MODE:g; \
s:@ARCANE_BUILD_TYPE@:$ARCANE_BUILD_TYPE:g; \
s:@ADDED_CMAKE@:$ADDED_CMAKE:g; \
s:@CMAKE_CONFIG@:$CMAKE_CONFIG:g; \
s*@DATE@*$(date +'%d/%m/%Y at %H:%M:%S')*g; \
" $DFIN > $DFOUT
then
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/weekly_images_creator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
dependencies: 'minimal'
build_type: 'check'

name: Build and Push arcane_${{ matrix.os_base }}:${{ matrix.compiler }}_${{ matrix.dependencies }}_${{ matrix.build_type }}
name: arcane_${{ matrix.os_base }}:${{ matrix.compiler }}_${{ matrix.dependencies }}_${{ matrix.build_type }}
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Display error
- name: Error message
if: ${{ failure() }}
run: echo "::error::Base image unknown, see available images here https://github.com/arcaneframework/framework-ci#images-disponibles"

Expand Down
175 changes: 173 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,173 @@
# containers
Containers with Arcane and Alien
# Containers with Arcane and Alien

This repository contains the files needed to build the Docker images
with Arcane and Alien. GH Actions is used to build the images and save
them in the "Package" part of this repository.

Two types of images are available: with Spack and without Spack.

- [Containers with Arcane and Alien](#containers-with-arcane-and-alien)
- [With Spack](#with-spack)
- [Without Spack](#without-spack)
- [Types](#types)
- [Tags](#tags)
- [Base images](#base-images)
- [Images updated every week](#images-updated-every-week)
- [Images generated on demand](#images-generated-on-demand)
- [Dockerfiles](#dockerfiles)
- [Images usage](#images-usage)

## With Spack

TODO


## Without Spack

These images are build without Spack. Packages are installed using
the package manager available by default (example: `apt` in Ubuntu).


### Types

Currently, there are two image sizes available :
- **minimal** : contains the minimal set of packages to be able to
use Arcane.
- **full** : contains the maximum set of packages to be able to use
the maximum of Arcane's features.

Also, there are three types of Arcane builds available :
- **release**: mode without checking or debug message,
- **check**: activates the check mode, in which you check for table
overflows. In this mode, the macro `ARCCORE_CHECK` is defined,
- **debug**: activates the `debug()` display macros and the check
mode. In this mode, the macros `ARCCORE_DEBUG` and
`ARCCORE_CHECK` are defined.

These types are found in tags.


### Tags

There are two types of tags :
1. An available compiler, latest version available
(example : `gcc-12_full_release_latest`);
2. An available compiler, with build date
(example : `gcc-12_full_release_20221219`).

Arcane and these components will have been compiled with the chosen
compiler.

The tag `1.` allows to have the last version of the image.
The tag `2.` allows you to choose an image according to its creation
date.

If you want to have the same working environment, the same versions of
the tools permanently (to reproduce bugs for example), this tag is good.


### Base images

To build our images, we use the images build to run CIs from the main
repository (framework). These are our "base images". They are available
here: https://github.com/arcaneframework/framework-ci#images-disponibles

These images include the packages needed to compile and run Arcane.
In this repository, we just add Arcane install in the image directly.


### Images updated every week

A set of images has been chosen to be automatically regenerated every
Sundays. These images will change every week (except if you choose a
tag with a creation date).

Here are the automatically regenerated images (you can change `latest`
by a date, see [here](https://github.com/orgs/arcaneframework/packages?repo_name=framework-ci)) :
- `arcane_ubuntu-2204:`
- `gcc-12`
- `_full_release_latest`
- `_full_check_latest`
- `_full_debug_latest`
- `_minimal_release_latest`
- `_minimal_debug_latest`

Example :
- `arcane_ubuntu-2204:gcc-12_full_release_latest`

These images are generated by the "Weekly Images Creator" workflow.


### Images generated on demand

It is also possible to generate images on demand. In fact, GH Actions
allows us to generate a simple interface allowing the user to make choices.
The "Image Creator" workflow uses this possibility to choose the image to
generate.

To use it, simply go to the "Actions" tab, go to the "Image Creator"
workflow, click on "Run workflow" and choose the image desired image.

This image will be build and available in "Package".

Note also that it is possible to generate only the Dockerfile by choosing
the appropriate option in the interface. The generated Dockerfile will be
available as an "Artifact".


### Dockerfiles

Because the Dockerfiles of each version are similar, we have a script
that generates the Dockerfiles according to the given options.
This script can be found here : `.github/scripts/DockerfileGenerator.sh`
and uses the `Dockerfile.in` from the same folder.

This script is used by GH Actions to generate Dockerfiles and this
generated file is used to generate the Docker images.
This script can also be used locally.

However, this script does not include a check for the existence of the
"base image". It is yours to do it
[(see here)](https://github.com/arcaneframework/framework-ci#images-disponibles)
.

Example of using the script :
```bash
cd .github/scripts
./DockerfileGenerator.sh -s ubuntu-2204 -c clang-15 -b full -a release
# Dockerfile for "arcane_ubuntu-2204:clang-15_full_release_latest" image.
```


### Images usage

In these images, Arcane is installed in the default installation
directory (`/usr/local`).
A user is also created and used by default. This is the user
`arcane_user`.
Note that `sudo` is not available, so if you want to run commands
as `root`, you need to specify the `root` user in the execute command:
`docker exec -u root -it <image> bash`.
If you want to compile an application using Arcane, it is not necessary
to specify the Arcane installation directory.

Here is a set of commands to compile and run `QAMA` in container :
```bash
# In a termuinal, with Podman or Docker installed.
IMAGE_ID=$(docker pull ghcr.io/arcaneframework/arcane_ubuntu-2204:gcc-12_minimal_release_latest)
CONTAINER_ID=$(docker run -dt "$IMAGE_ID")
docker exec -it "$CONTAINER_ID" bash

# Interactive terminal of contener.
cd /tmp
git clone https://github.com/arcaneframework/arcane-benchs
mkdir build/
cmake -S arcane-benchs/quicksilver/ -B build/ -GNinja
cmake --build build/

./build/src/Quicksilver \
-A,ReferenceDirectory=./arcane-benchs/quicksilver/reference_files/ \
./arcane-benchs/quicksilver/data/tests/ExampleFull.arc

exit
```

0 comments on commit 1b1635c

Please sign in to comment.