Compare commits
23 Commits
18bd8f039a
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
| bdeb7135ff | |||
|
|
867cc8c522 | ||
| db85eb865f | |||
| 1dd776a410 | |||
| cfdeef41cb | |||
| 7e743c1157 | |||
| 7c028ef02f | |||
| e0ba120da4 | |||
| 5a7f568ba6 | |||
| 229f6953aa | |||
| a814fbf4dc | |||
| 2e7bf4a0d5 | |||
| 1354b30863 | |||
| f5c7236767 | |||
| 7e15258536 | |||
| a868085ce3 | |||
| 6afb2523e3 | |||
| 7ec7e97801 | |||
| 17369559fe | |||
| c89bb8a389 | |||
| 2fadac0176 | |||
| 84ae56368b | |||
| e338459f66 |
@@ -11,6 +11,9 @@ on:
|
|||||||
- ready_for_review
|
- ready_for_review
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
BASE_DOMAIN: dataprovider01.sandbox-cat-dat.simpl-europe.eu
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-deleted-workflows:
|
check-deleted-workflows:
|
||||||
runs-on: orchestration-platform
|
runs-on: orchestration-platform
|
||||||
@@ -19,6 +22,9 @@ jobs:
|
|||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
|
env:
|
||||||
|
REPO_DIR: repo
|
||||||
|
REPO_CLONE_URL: https://gitea.${{ env.BASE_DOMAIN }}/dataprovider01/template-code-location.git
|
||||||
steps:
|
steps:
|
||||||
- name: Install git
|
- name: Install git
|
||||||
run: |
|
run: |
|
||||||
@@ -27,8 +33,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
run: |
|
run: |
|
||||||
REPO_DIR="repo"
|
|
||||||
REPO_CLONE_URL="https://gitea.dataprovider01.sandbox-cat-dat.simpl-europe.eu/dataprovider01/template-code-location.git"
|
|
||||||
CLONE_USER="${{ secrets.REGISTRY_USERNAME }}"
|
CLONE_USER="${{ secrets.REGISTRY_USERNAME }}"
|
||||||
CLONE_PASS="${{ secrets.REGISTRY_PASSWORD }}"
|
CLONE_PASS="${{ secrets.REGISTRY_PASSWORD }}"
|
||||||
|
|
||||||
@@ -55,12 +59,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Install project dependencies
|
- name: Install project dependencies
|
||||||
run: |
|
run: |
|
||||||
cd repo
|
cd "${REPO_DIR}"
|
||||||
uv sync --frozen --no-dev --no-install-package torch
|
uv sync --frozen --no-dev --no-install-package torch
|
||||||
|
|
||||||
- name: Compute deleted workflows/jobs against main
|
- name: Compute deleted workflows/jobs against main
|
||||||
run: |
|
run: |
|
||||||
cd repo
|
cd "${REPO_DIR}"
|
||||||
PATH="$PWD/.venv/bin:$PATH" \
|
PATH="$PWD/.venv/bin:$PATH" \
|
||||||
BASE_REF="${GITHUB_BASE_REF:-main}" \
|
BASE_REF="${GITHUB_BASE_REF:-main}" \
|
||||||
HEAD_REF="${GITHUB_HEAD_REF:-HEAD}" \
|
HEAD_REF="${GITHUB_HEAD_REF:-HEAD}" \
|
||||||
@@ -71,7 +75,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Compute active workflows list
|
- name: Compute active workflows list
|
||||||
run: |
|
run: |
|
||||||
cd repo
|
cd "${REPO_DIR}"
|
||||||
PATH="$PWD/.venv/bin:$PATH" \
|
PATH="$PWD/.venv/bin:$PATH" \
|
||||||
ONLY_ACTIVE="true" \
|
ONLY_ACTIVE="true" \
|
||||||
REGISTRY_USERNAME="${{ secrets.REGISTRY_USERNAME }}" \
|
REGISTRY_USERNAME="${{ secrets.REGISTRY_USERNAME }}" \
|
||||||
@@ -82,7 +86,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Fail only on overlap with active workflows
|
- name: Fail only on overlap with active workflows
|
||||||
run: |
|
run: |
|
||||||
cd repo
|
cd "${REPO_DIR}"
|
||||||
|
|
||||||
echo "--- Deleted workflows ---"
|
echo "--- Deleted workflows ---"
|
||||||
cat deleted_workflows.txt 2>/dev/null || echo "(none)"
|
cat deleted_workflows.txt 2>/dev/null || echo "(none)"
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ on:
|
|||||||
- main
|
- main
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
BASE_DOMAIN: dataprovider01.sandbox-cat-dat.simpl-europe.eu
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: orchestration-platform
|
runs-on: orchestration-platform
|
||||||
@@ -13,16 +16,13 @@ jobs:
|
|||||||
run:
|
run:
|
||||||
shell: sh
|
shell: sh
|
||||||
env:
|
env:
|
||||||
REGISTRY: gitea.dataprovider01.sandbox-cat-dat.simpl-europe.eu
|
REGISTRY: gitea.${{ env.BASE_DOMAIN }}
|
||||||
IMAGE_REPO: gitea.dataprovider01.sandbox-cat-dat.simpl-europe.eu/dataprovider01/template-code-location
|
IMAGE_REPO: gitea.${{ env.BASE_DOMAIN }}/dataprovider01/template-code-location
|
||||||
K8S_NAMESPACE: dataprovider01
|
REPO_DIR: repo
|
||||||
HELM_RELEASE: dataprovider01-dataprovider-orchestration-platform
|
REPO_CLONE_URL: https://gitea.${{ env.BASE_DOMAIN }}/dataprovider01/template-code-location.git
|
||||||
DAGSTER_CHART_VERSION: 0.2.0
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository (shell)
|
- name: Checkout repository (shell)
|
||||||
run: |
|
run: |
|
||||||
REPO_DIR="repo"
|
|
||||||
REPO_CLONE_URL="https://gitea.dataprovider01.sandbox-cat-dat.simpl-europe.eu/dataprovider01/template-code-location.git"
|
|
||||||
CLONE_USER="${{ secrets.REGISTRY_USERNAME }}"
|
CLONE_USER="${{ secrets.REGISTRY_USERNAME }}"
|
||||||
CLONE_PASS="${{ secrets.REGISTRY_PASSWORD }}"
|
CLONE_PASS="${{ secrets.REGISTRY_PASSWORD }}"
|
||||||
REF_NAME="${GITHUB_REF_NAME}"
|
REF_NAME="${GITHUB_REF_NAME}"
|
||||||
@@ -63,7 +63,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
COMMIT_SHA="${GITHUB_SHA:-$GITEA_SHA}"
|
COMMIT_SHA="${GITHUB_SHA:-$GITEA_SHA}"
|
||||||
SHORT_SHA="$(echo "${COMMIT_SHA}" | cut -c1-12)"
|
SHORT_SHA="$(echo "${COMMIT_SHA}" | cut -c1-12)"
|
||||||
cd repo
|
cd "${REPO_DIR}"
|
||||||
docker build \
|
docker build \
|
||||||
-t "${IMAGE_REPO}:latest" \
|
-t "${IMAGE_REPO}:latest" \
|
||||||
-t "${IMAGE_REPO}:${SHORT_SHA}" \
|
-t "${IMAGE_REPO}:${SHORT_SHA}" \
|
||||||
@@ -83,30 +83,30 @@ jobs:
|
|||||||
docker push "${IMAGE_REPO}:latest"
|
docker push "${IMAGE_REPO}:latest"
|
||||||
docker push "${IMAGE_REPO}:${SHORT_SHA}"
|
docker push "${IMAGE_REPO}:${SHORT_SHA}"
|
||||||
|
|
||||||
- name: Install kubectl
|
# The automated update of the deployment requires a technical user with
|
||||||
run: |
|
# their kube config in the secrets. See the user manual.
|
||||||
apk add --no-cache kubectl
|
# - name: Install kubectl
|
||||||
|
# run: |
|
||||||
|
# apk add --no-cache kubectl
|
||||||
|
|
||||||
- name: Setup kubectl
|
# - name: Setup kubectl
|
||||||
run: |
|
# run: |
|
||||||
mkdir -p "${HOME}/.kube"
|
# mkdir -p "${KUBE_CONFIG_DIR}"
|
||||||
echo "${{ secrets.KUBE_CONFIG_B64 }}" | base64 -d > "${HOME}/.kube/config"
|
# echo "${{ secrets.KUBE_CONFIG_B64 }}" | base64 -d > "${KUBE_CONFIG_FILE}"
|
||||||
chmod 600 "${HOME}/.kube/config"
|
# chmod 600 "${KUBE_CONFIG_FILE}"
|
||||||
|
|
||||||
- name: Update Dagster user deployment image
|
# - name: Update Dagster user deployment image
|
||||||
run: |
|
# run: |
|
||||||
COMMIT_SHA="${GITHUB_SHA:-$GITEA_SHA}"
|
# COMMIT_SHA="${GITHUB_SHA:-$GITEA_SHA}"
|
||||||
SHORT_SHA="$(echo "${COMMIT_SHA}" | cut -c1-12)"
|
# SHORT_SHA="$(echo "${COMMIT_SHA}" | cut -c1-12)"
|
||||||
|
|
||||||
DEPLOYMENT_NAME="dataprovider01-dataprovider-orchestration-platform-dagster-user-template-code-location"
|
# # Keep both the code server image and DAGSTER_CURRENT_IMAGE in sync.
|
||||||
|
# kubectl patch deployment "${DEPLOYMENT_NAME}" \
|
||||||
|
# -n "${K8S_NAMESPACE}" \
|
||||||
|
# --type='strategic' \
|
||||||
|
# -p="{\"spec\":{\"template\":{\"spec\":{\"containers\":[{\"name\":\"dagster-user-deployments\",\"image\":\"${IMAGE_REPO}:${SHORT_SHA}\",\"env\":[{\"name\":\"DAGSTER_CURRENT_IMAGE\",\"value\":\"${IMAGE_REPO}:${SHORT_SHA}\"}]}]}}}}"
|
||||||
|
|
||||||
# Keep both the code server image and DAGSTER_CURRENT_IMAGE in sync.
|
# # Wait for rollout to complete
|
||||||
kubectl patch deployment "${DEPLOYMENT_NAME}" \
|
# kubectl rollout status deployment/"${DEPLOYMENT_NAME}" \
|
||||||
-n "${K8S_NAMESPACE}" \
|
# -n "${K8S_NAMESPACE}" \
|
||||||
--type='strategic' \
|
# --timeout=5m
|
||||||
-p="{\"spec\":{\"template\":{\"spec\":{\"containers\":[{\"name\":\"dagster-user-deployments\",\"image\":\"${IMAGE_REPO}:${SHORT_SHA}\",\"env\":[{\"name\":\"DAGSTER_CURRENT_IMAGE\",\"value\":\"${IMAGE_REPO}:${SHORT_SHA}\"}]}]}}}}"
|
|
||||||
|
|
||||||
# Wait for rollout to complete
|
|
||||||
kubectl rollout status deployment/"${DEPLOYMENT_NAME}" \
|
|
||||||
-n "${K8S_NAMESPACE}" \
|
|
||||||
--timeout=5m
|
|
||||||
|
|||||||
@@ -33,5 +33,8 @@ def transform_example_dataset(df: pd.DataFrame) -> pd.DataFrame:
|
|||||||
|
|
||||||
df["total_price"] = df["quantity"] * df["unit_price"]
|
df["total_price"] = df["quantity"] * df["unit_price"]
|
||||||
|
|
||||||
|
df["price_band"] = df["total_price"].apply(
|
||||||
|
lambda value: "high" if value >= 25 else "standard"
|
||||||
|
)
|
||||||
|
|
||||||
return df
|
return df
|
||||||
|
|||||||
@@ -9,10 +9,11 @@ from template_code_location.jobs.jobs import (data_processing_job,
|
|||||||
from util_services.custom_json_logger import simpl_json_logger
|
from util_services.custom_json_logger import simpl_json_logger
|
||||||
from util_services.resources import s3_resource
|
from util_services.resources import s3_resource
|
||||||
|
|
||||||
|
|
||||||
defs = Definitions(
|
defs = Definitions(
|
||||||
jobs=[
|
jobs=[
|
||||||
example_job,
|
|
||||||
data_processing_job,
|
data_processing_job,
|
||||||
|
example_job,
|
||||||
k_anonymity_job_s3,
|
k_anonymity_job_s3,
|
||||||
l_diversity_job_s3,
|
l_diversity_job_s3,
|
||||||
t_closeness_job_s3,
|
t_closeness_job_s3,
|
||||||
|
|||||||
Reference in New Issue
Block a user