Skip to content

Commit

Permalink
image
Browse files Browse the repository at this point in the history
  • Loading branch information
DanRunfola committed Dec 5, 2024
1 parent b1878a9 commit 1f2d78c
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 202 deletions.
86 changes: 0 additions & 86 deletions .github/workflows/1buildCore.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/2buildCGAZ.yml

This file was deleted.

76 changes: 0 additions & 76 deletions .github/workflows/3pushChanges.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/buildImages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: geoBoundaries Base Image Build
run-name: gB Base Build
on: push
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Check out the repository
uses: actions/checkout@v3

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

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Define lowercase repository owner
id: repo
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: ./geoBoundaryBuilding/images/geoBoundariesBase.Dockerfile
push: true
tags: ghcr.io/${{ env.REPO_OWNER }}/gb-base:latest
build-args: BUILDKIT_STEP_LOG_MAX_SIZE=10485760 BUILDKIT_STEP_LOG_MAX_SPEED=100000000
env:
# Enable Docker CLI debug output
DOCKER_BUILDKIT: 1
DOCKER_CLI_EXPERIMENTAL: enabled
DEBUG: 1
Empty file added geoBoundaryBuilder/README.MD
Empty file.
59 changes: 59 additions & 0 deletions geoBoundaryBuilder/images/geoBoundariesBase.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Start with a statically versioned Alpine base image
FROM alpine:3.18

# Set environment variables to prevent interactive prompts and ensure consistent Python behavior
ENV PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1

# Install required system dependencies
RUN apk add --no-cache \
python3=3.11.5-r0 \
py3-pip=23.1.2-r0 \
gcc=12.3.1_git20230527-r0 \
musl-dev=1.2.4-r1 \
libffi-dev=3.4.4-r0 \
openssl-dev=3.1.2-r0 \
g++=12.3.1_git20230527-r0 \
make=4.3-r1 \
git=2.40.1-r0 \
git-lfs=3.4.0-r0 \
gdal=3.7.1-r0 \
geos-dev=3.11.1-r0 \
proj-dev=9.2.0-r0 \
jpeg-dev=9e-r0 \
zlib-dev=1.2.13-r1 \
cairo-dev=1.17.6-r0 \
py3-cffi=1.15.1-r3 \
py3-psycopg2=2.9.6-r0

# Install Python packages
RUN pip install --upgrade pip \
&& pip install \
prefect==2.2.0 \
kubernetes==25.3.0 \
geopandas==0.13.2 \
shapely==2.0.1 \
matplotlib==3.7.2 \
pandas==2.1.1 \
hashlib==20081119 \
jsonschema==4.19.0 \
zipfile36==0.1.3

# Install the Prefect Kubernetes package for Kubernetes-specific integrations
RUN pip install prefect-kubernetes

# Set up git-lfs
RUN git lfs install

# Create a directory for Prefect worker configuration (optional)
RUN mkdir -p /etc/prefect

# Expose Prefect's standard ports (if running agents/workers in the container)
EXPOSE 4200
EXPOSE 8080

# Set up default entrypoint (this can be overridden for specific workflows)
ENTRYPOINT ["prefect"]

# Optionally specify a default CMD to launch a Prefect worker (replace as needed)
#CMD ["worker", "start", "--pool", "kubernetes"]
2 changes: 1 addition & 1 deletion geoBoundaryBuilder/nfs_mount_inspect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Pod
metadata:
name: nfs-mount-tester
#namespace: geoboundaries
namespace: geoboundaries
spec:
restartPolicy: OnFailure
securityContext:
Expand Down
26 changes: 20 additions & 6 deletions geoBoundaryBuilder/queue_server_prefect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ kind: Pod
metadata:
name: prefect-server
namespace: geoboundaries
labels:
app: prefect-server # Ensures the service can select this pod
spec:
restartPolicy: Always
securityContext:
runAsUser: 71032
runAsGroup: 9915
containers:
- name: prefect-server
image: prefecthq/prefect:2.10.5
image: prefecthq/prefect:2.20-python3.10-kubernetes
command: ["prefect", "server", "start"]
args:
- "--host"
Expand All @@ -22,26 +24,38 @@ spec:
value: "sqlite:////sciclone/geograd/geoBoundaries/prefect/prefect.db"
- name: PREFECT_HOME
value: "/sciclone/geograd/geoBoundaries/prefect"
- name: PREFECT_SERVER_UI_STATIC_PATH
value: "/sciclone/geograd/geoBoundaries/prefect/ui_build" # Explicit path for UI static files
volumeMounts:
- name: prefect-persistence
mountPath: "/sciclone/geograd/geoBoundaries/prefect"
- name: ui-static
mountPath: "/usr/local/lib/python3.10/site-packages/prefect/server/ui_build"
lifecycle:
postStart:
exec:
command: ["sh", "-c", "mkdir -p /sciclone/geograd/geoBoundaries/prefect/ui_build && chmod -R 775 /sciclone/geograd/geoBoundaries/prefect/ui_build"]
volumes:
- name: prefect-persistence
nfs:
server: 128.239.59.144
path: /sciclone/geograd/geoBoundaries/prefect
- name: ui-static
nfs:
server: 128.239.59.144
path: /sciclone/geograd/geoBoundaries/prefect/ui_build
---
apiVersion: v1
kind: Service
metadata:
name: prefect-service
name: prefect-service-nodeport
namespace: geoboundaries
spec:
type: NodePort
selector:
app: prefect-server # Matches the app label on the pod
type: NodePort # External access via a specific port
ports:
- protocol: TCP
port: 4200
targetPort: 4200
nodePort: 30000 # Exposed port for external access
selector:
app: prefect-server
nodePort: 30000 # External port for access

0 comments on commit 1f2d78c

Please sign in to comment.