Commit graph

50 commits

Author SHA1 Message Date
Viktor Barzin
a742f9bb65
Fix frontend verify-deploy: remove stale 60s age filter
The age filter rejected pods older than 60s, but by the time the
verify step runs after build+publish+deploy, the new pods are often
already past that window. The image tag check is sufficient to
identify the correct deployment.
2026-02-21 23:50:20 +00:00
Viktor Barzin
0bb7e4c723
Parallelize API tests and build, gate publish on test pass
Same pattern as the frontend pipeline: build pushes to a staging
tag (build-N) in parallel with tests. Tests split into unit and
integration shards using a shared venv from the workspace. Publish
step uses skopeo to copy the manifest to final tags (:N, :latest,
:builder) only after all tests and the build succeed. Named the
final Dockerfile stage 'production' so target skips the test stage.
2026-02-21 23:46:16 +00:00
Viktor Barzin
68e7f2a334
Separate frontend image build from publish, gate publish on tests
Build step now pushes to a staging tag (build-N) in parallel with
test shards. A new publish step uses skopeo to copy the manifest to
the final tags (:N and :latest) only after all tests pass. This is
a server-side manifest copy with no layer re-upload.
2026-02-21 21:16:37 +00:00
Viktor Barzin
15dbcfa332
Parallelize frontend tests in Drone pipeline with 4 shards
Split the monolithic "build and test" kaniko step into a DAG:
tests run in 4 parallel shards (vitest --shard) alongside the
Docker image build, gated by a shared npm ci step. The kaniko
build now targets the named 'production' stage to skip the
in-Dockerfile test stage.
2026-02-21 21:02:22 +00:00
Viktor Barzin
a36c0dfdf7
Enable BuildKit in Drone API pipeline 2026-02-21 20:51:30 +00:00
Viktor Barzin
318385035e
fix: revert CI to use Docker Hub for caching — local registry is read-only pull-through cache 2026-02-21 15:25:36 +00:00
Viktor Barzin
b1be4d4170
perf: optimize CI pipeline — eliminate double dependency installs, use local registry cache
- Frontend Dockerfile: split into deps/test/builder/nginx stages so npm ci
  runs once (cached when package-lock.json unchanged), tests run in build
- Backend Dockerfile: add test stage that runs pytest inside the build,
  eliminating separate test image build
- .drone.yml: remove separate test steps (now inside Dockerfile builds),
  point cache_from/cache_repo at local registry (10.0.20.10:5000) instead
  of Docker Hub for faster layer cache pulls
2026-02-21 15:10:55 +00:00
Viktor Barzin
8f068a581e
Fix frontend CI pipeline OOM kills and test timeouts
- Set memory limit to 2048MiB for the "Run frontend tests" step
  (node:24-alpine was OOM killed at the default 1Gi)
- Set memory limit to 2048MiB for the "Build frontend image" kaniko
  step (also OOM killed at 1Gi)
- Increase vitest testTimeout to 30s (CI runner is ~75x slower than
  local dev; tests were timing out at the default 5s)
2026-02-17 21:46:29 +00:00
Viktor Barzin
7833bd3ecf
Add retry logic to Drone CI clone step for transient DNS failures
Disable the default clone and use a custom clone step with up to 5
retry attempts in both frontend and api pipelines. This prevents
builds from failing due to transient "Could not resolve host" errors.
2026-02-15 17:24:56 +00:00
Viktor Barzin
3acf8db7af
Switch frontend build to kaniko to avoid ephemeral-storage eviction
plugins/docker uses Docker-in-Docker which consumes significant
ephemeral storage for image layers. On nodes with disk pressure
(k8s-node1), the build pod gets evicted before completing.

Switch to plugins/kaniko which builds OCI images without a Docker
daemon, using significantly less ephemeral storage. Enable kaniko's
built-in layer caching via a dedicated cache repo.
2026-02-13 20:12:15 +00:00
Viktor Barzin
431e276d05
Remove cache builder stages to fix ephemeral-storage eviction
Both frontend and API pipelines had separate "Cache builder stage"
steps that built and pushed intermediate Docker targets purely for
layer caching. Running these alongside the actual build steps doubled
the Docker build work per pipeline, causing pods to be evicted when
the node hit its ephemeral-storage threshold (~20GB).

The "Build image" steps already use cache_from with the existing
:builder tags from previous builds, so the separate cache steps
are redundant for the common case (unchanged package files).
2026-02-13 19:52:17 +00:00
Viktor Barzin
25c87da1cf
Move NODE_OPTIONS before npm ci and bump pod memory to 4Gi
npm ci can also OOM during dependency installation. Move the heap
limit before npm ci so it applies to all Node processes. Bump Drone
pod limits to 4Gi (requests 2Gi) to cover Docker-in-Docker overhead.
2026-02-11 23:11:55 +00:00
Viktor Barzin
fd4864fd03
Fix frontend build OOM: skip tsc, use vite only, bump memory limits
- Replace `npm run build` (tsc -b && vite build) with `npx vite build`
  in Dockerfile since Vite transpiles via SWC independently of tsc.
  Type-checking is already done in the test step.
- Set Node heap to 1024MB (was 384MB which OOMed even for Vite)
- Bump Drone pod memory: requests 1.5Gi, limits 3Gi to cover
  plugins/docker overhead
2026-02-11 22:59:12 +00:00
Viktor Barzin
f9e4960783
Fix Drone resource spec: use bytes instead of Gi suffix 2026-02-11 22:05:04 +00:00
Viktor Barzin
6492741757
Fix frontend Docker build OOM: limit Node heap + request more memory
- Set NODE_OPTIONS=--max-old-space-size=512 in Dockerfile to cap tsc
  heap usage within constrained CI pods
- Add resource requests (1Gi) and limits (2Gi) to frontend Docker
  build steps in Drone pipeline
2026-02-11 21:50:16 +00:00
Viktor Barzin
96bcebdb40
Cache test image to speed up CI backend test step
Add a 'test' stage to Dockerfile that extends runtime-base with the
venv and test dependencies (pytest, fakeredis, etc.) pre-installed.
Drone CI now builds and caches this image as :test, then uses it
directly for running tests — eliminating apt-get and pip install
on every build.
2026-02-10 22:57:42 +00:00
Viktor Barzin
be12bdcb81
Add libgl1 and libglib2.0-0 to CI for OpenCV runtime deps 2026-02-10 22:32:44 +00:00
Viktor Barzin
35cf3fa862
Add pkg-config to CI test step for mysqlclient build 2026-02-10 22:26:38 +00:00
Viktor Barzin
6897820cc7
Add test steps to Drone CI pipelines before image builds
Frontend pipeline: runs vitest via node:24-alpine before building.
API pipeline: installs deps and runs pytest via python:3.13-slim before building.
Both steps fail-fast (-x) so broken tests block deployment.
2026-02-10 22:01:28 +00:00
Viktor Barzin
a3ac9cc060
Fix Drone CI variable interpolation in API verify-deploy step
Drone expands ${VAR} as its own variables before the shell runs, so
${BASE_API} and ${DEPLOY} were replaced with empty strings. Use $VAR
(no braces) so the shell handles them instead. Also add fallback for
empty jq output to prevent "sh: out of range" errors.
2026-02-10 21:32:11 +00:00
Viktor Barzin
b816f695f0
Replace deployment-level rollout check with pod-level verify-deploy
Check for a pod younger than 60s that is ready and running the exact
expected image tag, instead of polling deployment status fields.
2026-02-09 23:21:07 +00:00
Viktor Barzin
f3cbeb3f5e
Cache Docker builder stages in Drone CI for faster builds
Push intermediate builder stages as :builder tags and use cache_from
to reuse dependency layers (pip install, npm ci) across builds.
2026-02-09 21:35:42 +00:00
Viktor Barzin
6a1c35946e
Add rollout wait step to Drone CI pipelines
Both frontend and API pipelines now wait for K8s deployments to fully
roll out before marking the build as successful. Polls the K8s API
every 5s for up to 300s, checking observedGeneration, updatedReplicas,
and readyReplicas to confirm the new image is live in production.
2026-02-08 20:28:02 +00:00
Viktor Barzin
46995cb9da
Restart celery and celery-beat deployments on API image build
Prevents stale celery containers when code changes are deployed.
2026-02-08 20:09:10 +00:00
Viktor Barzin
5e48a26958
Pin deployment image to build number tag instead of restarting latest
Images are now tagged with both :latest and :${DRONE_BUILD_NUMBER}.
The deploy step uses JSON Patch to set the container image to the
specific build number tag, making deployments deterministic and
compatible with Terraform (which should ignore_changes on the image).
2026-02-07 23:07:16 +00:00
Viktor Barzin
eafbc1ac52
Flatten repo structure: move crawler/ to root, remove vqa/ and immoweb/
The crawler subdirectory was the only active project. Moving it to the
repo root simplifies paths and removes the unnecessary nesting. The
vqa/ and immoweb/ directories were legacy/unused and have been removed.

Updated .drone.yml, .gitignore, .claude/ docs, and skills to reflect
the new flat structure.
2026-02-07 23:01:20 +00:00
Viktor Barzin
7e05b3c971
Parallelise Dockerfile stages and enable CI layer caching
Split runtime apt-get into a separate stage so BuildKit runs it
concurrently with the builder's apt-get + pip install. Add cache_from
to the Drone CI API build step to reuse layers from the previous image.
2026-02-07 11:06:35 +00:00
Viktor Barzin
3ef2df63b9
Limit Drone CI pipeline concurrency to 1 2026-02-07 10:52:54 +00:00
Viktor Barzin
30e6a0bf06
Add 20-minute timeout to Drone CI pipelines 2026-02-07 10:51:24 +00:00
Viktor Barzin
22aa9c86a7
update drone.yaml to build on push 2026-02-01 21:53:18 +00:00
Viktor Barzin
f88bba032f
Test without secret 2026-02-01 20:58:20 +00:00
Viktor Barzin
dc1186601a Final webhook test 2026-02-01 20:54:53 +00:00
Viktor Barzin
4969df8745 Test new webhook 2026-02-01 20:51:13 +00:00
Viktor Barzin
ccef50b371 Trigger webhook 2026-02-01 20:47:50 +00:00
Viktor Barzin
1680cda7b7 Test webhook with secret 2026-02-01 20:45:52 +00:00
Viktor Barzin
93f7f57de3 Trigger build test 2026-02-01 20:29:56 +00:00
Viktor Barzin
6d17d2ccad Fix Drone CI trigger to allow push events
Remove cron filter that was blocking push events from triggering builds.
The cron filter was applying to all events, not just cron jobs.
2026-02-01 20:25:32 +00:00
Viktor Barzin
997084d0f2 Trigger CI build test 2026-02-01 20:18:35 +00:00
Viktor Barzin
3f427b062c Test push trigger 2026-02-01 20:03:53 +00:00
Viktor Barzin
aad9bdd950 Add push trigger to Drone CI pipeline
Build on every push to master branch in addition to nightly cron builds.
2026-02-01 19:56:00 +00:00
Viktor Barzin
1f04753250
fix typoe in drone config when restarting the deployments 2025-06-21 21:58:58 +00:00
Viktor Barzin
97e3fb9e4e
cache from in drone with tag 2025-06-21 19:59:30 +00:00
Viktor Barzin
7a21a032b7
remove image tag for caching in drone 2025-06-21 18:52:13 +00:00
Viktor Barzin
41ef6400da
use cache for immoweb image 2025-06-21 18:49:31 +00:00
Viktor Barzin
81683ce73b
update dronce ci to built on top of previous image for api 2025-06-21 18:20:43 +00:00
Viktor Barzin
064f2651d5
set 30m timeout to drone builds 2025-06-21 12:50:31 +00:00
Viktor Barzin
7ae822f115
trigger ci only on daily cron instead of on every push 2025-06-17 19:10:49 +00:00
Viktor Barzin
92c1ee76f5
add pipeline to build the backend api 2025-06-17 18:56:52 +00:00
Viktor Barzin
76e7338ab9
add context dir to the drone.yml 2025-06-17 18:51:23 +00:00
Viktor Barzin
0bee75fd71
add drone ci config 2025-06-17 18:45:28 +00:00