-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into improve-mean-eccentric-anomaly
- Loading branch information
Showing
50 changed files
with
4,749 additions
and
2,234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,51 @@ | ||
FROM python:3.10-alpine as pdm | ||
FROM julia:1.10-bookworm as julia-builder | ||
|
||
RUN mkdir -p /tmp/pdm | ||
COPY pyproject.toml pdm.lock /tmp/pdm/ | ||
COPY Project.toml Manifest.toml /root/.julia/environments/v1.10/ | ||
|
||
WORKDIR /tmp/pdm | ||
RUN julia -e "using Pkg; Pkg.instantiate(); Pkg.precompile();" | ||
|
||
FROM python:3.12-slim-bookworm as python-builder | ||
|
||
ENV PIP_ROOT_USER_ACTION=ignore | ||
|
||
RUN --mount=type=cache,target=/root/.cache \ | ||
pip3 --disable-pip-version-check install pdm \ | ||
&& pdm export -f requirements > /tmp/pdm/requirements.txt | ||
|
||
FROM alpine:3 as julia | ||
ARG JULIA_VERSION=1.9.0-rc1 | ||
ARG JULIA_ARCH="x86_64" | ||
|
||
RUN mkdir -p /tmp/julia | ||
WORKDIR /tmp | ||
|
||
RUN set -x && \ | ||
if [ "$JULIA_ARCH" == "aarm64" ]; then \ | ||
JULIA_ARCH="aarch64"; \ | ||
S3_ARCH="aarch64"; \ | ||
elif [ "$JULIA_ARCH" == "aarch64" ]; then \ | ||
S3_ARCH="aarch64"; \ | ||
elif [ "$JULIA_ARCH" == "x86_64" ]; then \ | ||
S3_ARCH="x64"; \ | ||
fi; \ | ||
JULIA_INSTALLER="julia-${JULIA_VERSION}-linux-${JULIA_ARCH}.tar.gz" \ | ||
&& wget --quiet "https://julialang-s3.julialang.org/bin/checksums/julia-${JULIA_VERSION}.sha256" \ | ||
&& wget --quiet "https://julialang-s3.julialang.org/bin/linux/${S3_ARCH}/${JULIA_VERSION:0:3}/${JULIA_INSTALLER}" \ | ||
&& grep ${JULIA_INSTALLER} "julia-${JULIA_VERSION}.sha256" | sha256sum -cs \ | ||
&& tar -xf "${JULIA_INSTALLER}" -C /tmp/julia --strip-components=1 \ | ||
&& rm "${JULIA_INSTALLER}" | ||
|
||
FROM python:3.10-bullseye as workspace | ||
python -m pip install pdm | ||
|
||
COPY pyproject.toml pdm.lock /project/ | ||
WORKDIR /project | ||
RUN --mount=type=cache,target=/root/.cache \ | ||
mkdir __pypackages__ \ | ||
&& pdm sync | ||
|
||
FROM python:3.12-bookworm as workspace | ||
|
||
ARG USERNAME=vscode | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
ARG JULIA_DIR=/opt/julia | ||
|
||
ENV PATH="${JULIA_DIR}/bin:${PATH}" \ | ||
HOME="/home/${USERNAME}" | ||
ENV HOME="/home/${USERNAME}" \ | ||
PYTHONPATH=/project/pkgs \ | ||
JULIA_PATH=/usr/local/julia \ | ||
JULIA_HOME=/home/${USERNAME}/.julia | ||
|
||
# Has to be a separate instruction to get the JULIA_PATH variable | ||
ENV PATH="${JULIA_PATH}/bin:${PATH}" | ||
|
||
COPY .devcontainer/fix-permissions /usr/local/bin/fix-permissions | ||
RUN chmod a+rx /usr/local/bin/fix-permissions | ||
|
||
# Create USERNAME with name vscode user with UID=1000 and in the 'users' group | ||
# and make sure these dirs are writable by the `users` group. | ||
# Create USERNAME with name vscode with UID=1000 and in the 'users' group | ||
RUN groupadd --gid ${USER_GID} ${USERNAME} \ | ||
&& useradd --uid $USER_UID --gid ${USERNAME} --shell /bin/bash --create-home ${USERNAME} \ | ||
&& mkdir -p "${JULIA_DIR}" \ | ||
&& chown "${USER_UID}:${USER_GID}" "${JULIA_DIR}" \ | ||
&& chmod g+w /etc/passwd \ | ||
&& fix-permissions "${HOME}" \ | ||
&& fix-permissions "${JULIA_DIR}" | ||
|
||
COPY --from=pdm /tmp/pdm/requirements.txt /tmp/pip-tmp/ | ||
RUN --mount=type=cache,target=/root/.cache \ | ||
pip3 --disable-pip-version-check install -r /tmp/pip-tmp/requirements.txt \ | ||
&& rm -rf /tmp/pip-tmp | ||
&& useradd --uid ${USER_UID} --gid ${USER_GID} --shell /bin/bash --create-home ${USERNAME} | ||
|
||
USER ${USERNAME} | ||
COPY --from=python-builder /project/__pypackages__/3.12/lib /project/pkgs | ||
COPY --from=python-builder /project/__pypackages__/3.12/bin/* /bin/ | ||
COPY --from=julia-builder /usr/local/julia ${JULIA_PATH} | ||
COPY --from=julia-builder /root/.julia ${HOME}/.julia | ||
|
||
COPY --from=julia /tmp/julia/ "${JULIA_DIR}/" | ||
COPY .devcontainer/packages.jl /tmp/packages.jl | ||
RUN chown -R "${USER_UID}:${USER_GID}" "${JULIA_HOME}" \ | ||
&& fix-permissions "${JULIA_HOME}" | ||
|
||
RUN fix-permissions "${JULIA_DIR}" | ||
RUN julia "/tmp/packages.jl" \ | ||
&& fix-permissions "${HOME}/.julia" | ||
USER ${USERNAME} | ||
|
||
WORKDIR /workspaces/orbital-mechanics-notes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
{ | ||
"globs": ["**/*.md", "!.venv"], | ||
"globs": [ | ||
"**/*.md", | ||
"!.venv", | ||
"!_build", | ||
"!_static" | ||
], | ||
"config": { | ||
"MD003": false, | ||
"MD013": false, | ||
"MD037": false | ||
"MD024": false, | ||
"MD033": false, | ||
"MD037": false, | ||
"MD041": false, | ||
"MD055": false, | ||
"MD056": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,28 @@ | ||
[tools] | ||
python = { version = "3.11", virtualenv = ".venv" } | ||
python = { version = "3.12", virtualenv = ".venv" } | ||
markdownlint-cli2 = "latest" | ||
pdm = "latest" | ||
julia = "latest" | ||
|
||
[plugins] | ||
pdm = "https://github.com/1oglop1/asdf-pdm" | ||
markdownlint-cli2 = "https://github.com/paulo-ferraz-oliveira/asdf-markdownlint-cli2" | ||
julia = "https://github.com/rkyleg/asdf-julia.git" | ||
|
||
[tasks] | ||
lint = { depends = [ | ||
"ruff_check_lint", | ||
"ruff_format_lint", | ||
"markdownlint_lint", | ||
], description = "Run all the linter tools", env = { MISE_JOBS = "1" } } | ||
ruff_check_lint = { description = "Run the ruff linter", run = "ruff check ." } | ||
ruff_format_lint = { run = "ruff format --check .", description = "Run the ruff formatter in check mode" } | ||
markdownlint_lint = { run = "markdownlint-cli2", description = "Run markdownlint" } | ||
ruff_check_format = { run = "ruff check --fix .", description = "Run the ruff linter in fix mode" } | ||
ruff_format_format = { run = "ruff format .", description = "Run the ruff formatter" } | ||
markdownlint_format = { run = "markdownlint-cli2 --fix", description = "Run markdownlint in fix mode" } | ||
format = { depends = [ | ||
"ruff_check_format", | ||
"ruff_format_format", | ||
"markdownlint_format", | ||
], description = "Run all the formatting tools", env = { MISE_JOBS = "1" } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
# mise description="Build the book" | ||
# mise env={PYDEVD_DISABLE_FILE_VALIDATION = "1"} | ||
# mise source=["**/*.md", "**/*.ipynb", "**/*.svg"] | ||
# mise outputs=["_build/html/**/*.html"] | ||
jupyter-book build -W . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
// "---([\\n\\(\\)]|[^(\\$\\$)])*---" | ||
// ] | ||
} | ||
] | ||
], | ||
"editor.formatOnSave": true | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# Install/Build the Book | ||
|
||
The repo is set up to use [mise](https://mise.jdx.dev) to install required tools. Once `mise` is installed, changing into this directory should install the correct tools with the right versions. | ||
The repo is set up to use [mise](https://mise.jdx.dev) to install required tools. Once `mise` is installed, changing into this directory should install the correct tools with the right versions. If not, run `mise install` to install everything. | ||
|
||
After that, running `pdm install` should install the dependencies. Then `doit build_jb` will build the book. | ||
|
||
If you want to work on the book, you may also need to install Julia dependencies. `mise` should install Julia. Running `julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.precompile();'` should install dependencies in a local project. |
Oops, something went wrong.