-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker and Python build enhancements (#1547)
Misc. Docker and Python improvements * Add standardized metadata to the Docker image, including the version, commit hash, and build timestamp. This makes it easier to determine what the container was actually built from. * Cleanup docker/README. Remove old unsupported docker-compose and replace with modern docker compose, add some missing variables, add some aliases, and some formatting tweaks. * Add and cleanup Python package metadata in setup.py, notably README formatting, and python_version (which helps pip and dependency resolvers like PDM and Poetry).
- Loading branch information
1 parent
da0b90c
commit 90fff34
Showing
6 changed files
with
98 additions
and
48 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 |
---|---|---|
|
@@ -10,6 +10,7 @@ Jeremy Erickson <[email protected]> | |
John Floren <[email protected]> | ||
David Fritz <[email protected]> | ||
Jason Gao <[email protected]> | ||
Christopher Goes <[email protected]> | ||
Casey Glatter <[email protected]> | ||
Arthur Hernandez <[email protected]> | ||
Darek Jensen <[email protected]> | ||
|
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,10 @@ | ||
# To specify an alternate base image: --build-arg BASE_IMAGE="some/other/image:tag" | ||
ARG BASE_IMAGE="ubuntu:22.04" | ||
|
||
# -- go builder -- | ||
FROM golang:1.18.2 AS gobuilder | ||
|
||
ENV DEBIAN_FRONTEND="noninteractive" | ||
RUN apt-get update && apt-get install -y libpcap-dev | ||
|
||
WORKDIR /minimega/ | ||
|
@@ -9,14 +14,34 @@ COPY . . | |
RUN ./scripts/all.bash | ||
|
||
|
||
FROM ubuntu:22.04 | ||
|
||
RUN apt update && apt install -y \ | ||
dnsmasq iproute2 isc-dhcp-client \ | ||
libpcap-dev ntfs-3g openssh-client \ | ||
openvswitch-switch qemu-kvm qemu-utils \ | ||
# -- minimega image -- | ||
FROM ${BASE_IMAGE} | ||
|
||
# General image metadata | ||
# Reference: https://github.com/opencontainers/image-spec/blob/main/annotations.md | ||
ARG BUILD_TIME | ||
ARG MM_VERSION | ||
ARG MM_COMMIT | ||
LABEL org.opencontainers.image.created="${BUILD_TIME}" \ | ||
org.opencontainers.image.authors="minimega dev team <[email protected]>" \ | ||
org.opencontainers.image.documentation="https://www.sandia.gov/minimega/" \ | ||
org.opencontainers.image.source="https://github.com/sandia-minimega/minimega" \ | ||
org.opencontainers.image.version="${MM_VERSION}" \ | ||
org.opencontainers.image.revision="${MM_COMMIT}" \ | ||
org.opencontainers.image.vendor="Sandia National Laboratories" \ | ||
org.opencontainers.image.licenses="GPL-3.0-only" \ | ||
org.opencontainers.image.title="minimega" \ | ||
org.opencontainers.image.description="minimega is a tool for launching and managing virtual machines" | ||
|
||
ENV DEBIAN_FRONTEND="noninteractive" | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
dnsmasq iproute2 isc-dhcp-client \ | ||
libpcap-dev ntfs-3g openssh-client \ | ||
openvswitch-switch qemu-kvm qemu-utils \ | ||
&& apt autoremove -y \ | ||
&& apt clean -y\ | ||
&& apt-get clean -y \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rm -rf /var/cache/apt/archives/* | ||
|
||
|
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,4 +1,3 @@ | ||
version: '3.7' | ||
services: | ||
minimega: | ||
build: | ||
|
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,4 +1,4 @@ | ||
from distutils.core import setup | ||
from setuptools import setup | ||
|
||
|
||
with open("README", "r") as readme_file: | ||
|
@@ -9,14 +9,23 @@ | |
|
||
setup( | ||
name='minimega', | ||
description="Python API for minimega", | ||
version=version, | ||
author="minimega dev team", | ||
author_email="[email protected]", | ||
description="Python API for minimega", | ||
long_description=readme_content, | ||
long_description_content_type="text/markdown", | ||
license="GPLv3", | ||
url="https://minimega.org", | ||
version=version, | ||
url="https://www.sandia.gov/minimega/", | ||
project_urls={ | ||
"homepage": "https://www.sandia.gov/minimega/", | ||
"repository": "https://github.com/sandia-minimega/minimega", | ||
"changelog": "https://www.sandia.gov/minimega/minimega-2-9-release-notes/", | ||
"documentation": "https://www.sandia.gov/minimega/using-minimega/", | ||
"issues": "https://github.com/sandia-minimega/minimega/issues", | ||
}, | ||
py_modules=["minimega"], | ||
python_requires=">=3.6", | ||
classifiers=[ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Console", | ||
|
@@ -30,6 +39,11 @@ | |
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Topic :: Internet", | ||
"Topic :: Scientific/Engineering", | ||
"Topic :: System :: Clustering", | ||
|