Skip to content

Commit

Permalink
Initial commit - docs copied from uw3 repo
Browse files Browse the repository at this point in the history
  • Loading branch information
lmoresi committed Mar 26, 2024
1 parent 07556a2 commit 593d913
Show file tree
Hide file tree
Showing 399 changed files with 1,585,185 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
8 changes: 8 additions & 0 deletions .binder/apt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
libgl1-mesa-glx
libxcursor-dev
libglu1
libxft2
libxinerama1
libfltk1.3-dev
libfreetype6-dev
libgl1-mesa-dev
32 changes: 32 additions & 0 deletions .binder/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: uw3
channels:
- jgiordani
- conda-forge
dependencies:
- python=3.11
- jgiordani::uw3_env
- mpmath<=1.3
- mesalib
- numpy
- scipy
# - mpich-mpicc
# - mpich-mpicxx
# - cython=3.*
# - petsc>=3.20.5
# - petsc4py>=3.20.5
# - mpi4py
# - h5py
- sympy
- pytest
- ipython
- pyvista[all]
- quarto
- pip
- pip:
- gmsh
- jupyterlab>=4.1
- jupytext>=1.16.1
- pygments>=2.17.0
- trame-vtk
- trame-vuetify

45 changes: 45 additions & 0 deletions .binder/postBuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash -v


# echo
# echo Install uw3_env during postBuild phase
# echo

# conda env list

# # conda init
# # conda activate notebook
# # mamba install --yes -c jgiordani uw3_env

echo
echo Install jupyter extensions
echo

# install required python packages
python3 -m pip install "jupyter-server-proxy"
python3 -m pip install "jupyterlab-quarto>=0.3.3"
python3 -m pip install "jupytext>=1.16.1"
python3 -m pip install "trame_jupyter_extension"

# We install the local code "properly" - no point in a dev build here

echo
echo Install local UW3
echo

# Note: we would be better to find a way to access this directly
# CONDA_PREFIX=`conda run -n notebook bash -c "echo \${CONDA_PREFIX}"`

export CONDA_PREFIX=/srv/conda/envs/notebook/
export PYTHONPATH=$CONDA_PREFIX/lib

# debugging if required
# python -c "import petsc4py; print(petsc4py.get_config())"
# python -c "from petsc4py import PETSc; print('Imported PETSc')"

pip install .


echo
echo Completed
echo
8 changes: 8 additions & 0 deletions .binder/start
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

## This is not required for the conda-forge version of petsc but
## it is needed if we install the uw3_env dependencies

export PYTHONPATH=$CONDA_PREFIX/lib/

exec "$@"
28 changes: 28 additions & 0 deletions .github/.devcontainer/DOCKERFILE_GHCS
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM mcr.microsoft.com/devcontainers/miniconda:0-3

RUN conda install -n base -c conda-forge mamba

# Here we can install all the dependencies using mamba (as we do in the test scripts)

COPY .devcontainer/uw_environment.yml /tmp/conda-tmp/
RUN mamba env update -n base --file /tmp/conda-tmp/uw_environment.yml

RUN export PETSC_DIR=/opt/conda \
&& pip install petsc4py

RUN pip install gmsh

# Add other dependencies that can't be installed correctly.

##
## gmsh seems to be broken in this installation
##

# [Optional] Uncomment to install a different version of Python than the default
# RUN conda install -y python=3.6 \
# && pip install --no-cache-dir pipx \
# && pipx reinstall-all

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get install ffmpeg libsm6 libxext6
23 changes: 23 additions & 0 deletions .github/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/miniconda
{
"name": "Underworld3",
"build": {
"context": "..",
"dockerfile": "DOCKERFILE_GHCS"
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// The following are needed by gmsh even though we don't want to use X
"features": {
"ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
"packages": "libgl1,libcairo2-dev,libxcursor-dev, libxinerama-dev"
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": []
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "conda init && cd /workspaces/underworld3 && export PETSC_DIR=/opt/conda && python3 setup.py build_ext && sudo -E /opt/conda/bin/pip install ."
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
20 changes: 20 additions & 0 deletions .github/.devcontainer/uw_environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: uw3_runtime
channels:
- conda-forge
dependencies:
- python=3.10
- numpy
- sympy
- mpich-mpicc
- mpich-mpicxx
- cython
- petsc=3.18.0
- mpi4py
- h5py
- mesalib
- pytest
- ipython # needed for "display" functionality (should be optional !)
- pyvista # flagged in some tests (should not be needed for tests !)
- pip


12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.
What version of underworld3 are you running and how to reproduce the bug.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/runtime-error.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Runtime Error
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the runtime issue**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
E.g. Model snippet, or command line used.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment (please complete the following information):**
- OS: [e.g. iOS]
- Version [e.g. 0.5]

**Additional context**
Add any other context about the problem here.
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/🐛-bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: "\U0001F41B Bug report"
about: Create an report to help us improve
title: "[BUG] - add title"
labels: ''
assignees: ''

---

**Describe the bug**
- What is the bug?
- What version code?
- What system are you running the code on?
- Steps to reproduce?

**Screenshots**
38 changes: 38 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
push:
branches:
- main
workflow_dispatch:

jobs:

build_docker_image:
name: Build Underworld 3 Docker image
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PWORD }}

- name: Build Base Docker Image
uses: docker/build-push-action@v3
with:
context: .
push: true
file: ./Dockerfile
platforms: linux/amd64, linux/arm64
tags: underworldcode/carbonite
52 changes: 52 additions & 0 deletions .github/workflows/build_deploy_jbdoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: API docs / jupyterbook

# We should trigger this from an upload event

on:
push: # We publish the beta docs as well - but on a different url (by branch name)
branches:
- main
- development


workflow_dispatch:

jobs:
deploy:
runs-on: macos-latest
steps:

- uses: actions/checkout@v3


- name: Install Conda environment with Micromamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: ./.github/workflows/envs/build_jb.yml
cache-downloads: true

# - name: install jupyterbook dependencies
# run: |
# pip install jupyter-book
# pip install jupytext

- name: Build docs with jupyterbook
shell: bash -l {0}
run: |
cd Jupyterbook
./build_book.sh
## Always deploy to version directory
- name: Deploy JB
uses: peaceiris/actions-gh-pages@v3

with:
# deploy_key: ${{ secrets.GH_PAGES_DEPLOY_PR_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
destination_dir: ${{ github.ref_name }} # The dest dir is identified by branch
publish_dir: jupyterbook/_build/html




Loading

0 comments on commit 593d913

Please sign in to comment.