Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@peterroelants
peterroelants / GMM-discrete.ipynb
Last active August 13, 2021 10:01
Numpyro AssertionError sample(key=None)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@peterroelants
peterroelants / hv_cmap_alpha.ipynb
Last active July 14, 2021 15:17
Holoviews Bokeh cmap alpha not working
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@peterroelants
peterroelants / Dockerfile
Last active May 2, 2021 10:54
Build minimal Python environment with Pydantic
# Build with:
# DOCKER_BUILDKIT=1 docker build --progress=plain --target pydantic_env --tag pydantic-test-env --file ./pydantic/pydantic.static.Dockerfile .
#
# Uses multi-stage builds.
#
# Stage 1: Temporarity builder
FROM python:3.9.2-slim-buster as builder
ARG PYDANTIC_VERSION=1.8.1
@peterroelants
peterroelants / jax_conda_env.yml
Last active April 5, 2021 11:41
JAX FFT Convove
name: jax_deps
channels:
- conda-forge
dependencies:
- flake8
- jaxlib
- jupytext
- jupyter-sphinx
- matplotlib
- mypy
@peterroelants
peterroelants / alluxio.fuse.compose.yml
Created March 12, 2021 09:09
Alluxio with FUSE container setup based on Alluxio Documentation
# Alluxio Docker Deployment
# Based on "Using User-Defined Network" configuration from:
# https://docs.alluxio.io/os/user/stable/en/deploy/Running-Alluxio-On-Docker.html
version: '3.8'
networks:
alluxio-network:
name: alluxio-network
driver: bridge
@peterroelants
peterroelants / docker-compose.yml
Last active February 25, 2021 18:25
Alluxio glasfish error
# Alluxio Docker Deployment
# Based on "Using User-Defined Network" configuration from:
# https://docs.alluxio.io/os/user/stable/en/deploy/Running-Alluxio-On-Docker.html
version: '3.8'
networks:
alluxio_network:
name: alluxio_network
driver: bridge
@peterroelants
peterroelants / pip_compile_snippet.Dockerfile
Created February 12, 2021 09:58
Reduce python container size by compiling with pip
# Install python packages with pip using compilation to reduce size
# - https://towardsdatascience.com/how-to-shrink-numpy-scipy-pandas-and-matplotlib-for-your-data-product-4ec8d7e86ee4
# - https://avilpage.com/2020/02/reduce-python-package-footprint.html
# - https://stackoverflow.com/a/22942120
# - https://blog.mapbox.com/aws-lambda-python-magic-e0f6a407ffc6
# `/usr/local/bin/python3-config --cflags` should be applied automatically, the
# following flags extend these.
RUN pip install --upgrade pip \
&& export CFLAGS="${CFLAGS} -g0 -Wl,--strip-all -Os -I/usr/include:/usr/local/include" \
&& export LDFLAGS="${LDFLAGS} -L/usr/lib:/usr/local/lib" \
@peterroelants
peterroelants / Dockerfile
Created January 24, 2021 14:52
tini standalone docker install
# Install tini for entrypoint
# More info:
# - https://github.com/krallin/tini
# Checksum from https://github.com/krallin/tini/releases/download/v0.19.0/tini.sha256sum
ARG TINI_DOWNLOAD_URL=https://github.com/krallin/tini/releases/download/v0.19.0/tini
ARG TINI SHA256HASH="93dcc18adc78c65a028a84799ecf8ad40c936fdfc5f2a57b1acda5a8117fa82c"
ADD ${TINI_DOWNLOAD_URL} /opt/runtime/tini
RUN if ! echo "${SHA256HASH} /opt/runtime/tini" | sha256sum --check --status ; then exit 1 ; fi && \
chmod +x /opt/runtime/tini