Skip to content

feat: implement /opt/fournos/entrypoint contract for FORGE engine - #2

Closed
ashtarkb wants to merge 1260 commits into
mainfrom
fournos-entrypoint-contract
Closed

ashtarkb wants to merge 1260 commits into
mainfrom
fournos-entrypoint-contract

Conversation

@ashtarkb

Copy link
Copy Markdown
Owner

Summary

Move all FORGE-specific bootstrap logic from inline YAML bash into a single bin/fournos_entrypoint script, implementing the Fournos execution-engine entrypoint contract (/opt/fournos/entrypoint).

This is the FORGE-side counterpart to the Fournos multi-engine decoupling work (ashtarkb/fournos#1).

Motivation

Previously, FORGE bootstrap bash (~170 lines total) was duplicated across three YAML files — two in the FORGE gitops repo and one in the Fournos repo. This coupling meant:

  • Only FORGE could run on Fournos
  • Changes to bootstrap logic required editing 3 files
  • Fournos had to ship FORGE-specific code

The new Fournos architecture defines a universal contract: every engine image provides /opt/fournos/entrypoint. Both the resolve Job and Tekton Tasks just call command: ["/opt/fournos/entrypoint"] — no engine-specific bash in YAML.

Changes

New: bin/fournos_entrypoint

The single source of truth for all FORGE bootstrap logic (~110 lines). Sequence:

  1. Validates required env vars (FJOB_NAME, FOURNOS_WORKLOAD_NAMESPACE, FOURNOS_STEP)
  2. Sets up artifact directories and logging
  3. Fetches the FournosJob spec via oc get fjob/...
  4. Sets up target-cluster kubeconfig or clusterless mode
  5. Exports all spec.env.* keys as environment variables
  6. Checks out the PR commit (PULL_PULL_SHA or PULL_NUMBER)
  7. Reads spec.executionEngine.forge.project
  8. Execs bin/run_ci "$FORGE_PROJECT" ci "$FOURNOS_STEP"

Modified: projects/core/image/Containerfile

  • Installs yq (used by the entrypoint to parse FournosJob YAML)
  • Creates /opt/fournos/entrypoint symlink → $APP_HOME/bin/fournos_entrypoint

Modified: fournos/gitops/base/workflows/task-forge-step.yaml

  • Removed ~80 lines of inline bash script: block
  • Added command: ["/opt/fournos/entrypoint"] and args: []
  • Added ARTIFACT_DIR env var pointing to the Tekton workspace path
  • Comments updated to reflect the entrypoint-based architecture

Modified: fournos/gitops/base/workflows/resolve-job.yaml

  • Removed ~50 lines of inline bash in args:
  • Added command: ["/opt/fournos/entrypoint"] and args: []
  • Comments updated: this is now a GitOps-managed variant, not the canonical template

Before → After

Location Before After
task-forge-step.yaml ~80 lines inline bash command: ["/opt/fournos/entrypoint"]
resolve-job.yaml ~50 lines inline bash command: ["/opt/fournos/entrypoint"]
bin/fournos_entrypoint did not exist ~110 lines (single source of truth)
Containerfile no yq, no symlink installs yq + creates /opt/fournos/entrypoint symlink

Net effect: ~130 lines of duplicated inline bash replaced by 1 canonical script + 2 one-liner invocations.

Made with Cursor

kpouget and others added 30 commits September 15, 2026 22:09
[core] library: export_notifications: adjust the post-processing status
…o-version-conflict

fix: Resolve kaleido version conflict breaking image builds
[core] Finish updating the get_ci_metadata_dir function
[legacy] Remove the MatrixBenchmarking and Topsail artifacts
[core] notifications: send: update the CI base link
…forge-resolver

gitops: add an Intlab Forge overlay
…forge-resolver

rhaiis: add B200 cluster preset
…amd-vllm-image

rhaiis: update default AMD vLLM image
kpouget and others added 27 commits September 23, 2026 22:00
[core] notifications: send: accept the foreign testing PR number
[core] ci_entrypoint: prepare_ci: skip the git banner in when foreign testing
[core] notifications: send: properly disable the github export to avoid the test to fail
[core] ci_entrypoint: fournos: don't crash in the resolve step
…ign-repository-checkout

[foreign-testing] Initialize foreign repository checkout
```
 projects/caliper/engine/model.py:11
    /home/kpouget/openshift/forge/projects/caliper/engine/
  model.py:11: PytestCollectionWarning: cannot collect
  test class 'TestBaseNode' because it has a __init__
  constructor (from:
  projects/guidellm/tests/test_dashboard.py)
      @DataClass

  projects/caliper/engine/model.py:11
    /home/kpouget/openshift/forge/projects/caliper/engine/
  model.py:11: PytestCollectionWarning: cannot collect
  test class 'TestBaseNode' because it has a __init__
  constructor (from:
  projects/guidellm/tests/test_postprocess_parser.py)
      @DataClass

  -- Docs: https://docs.pytest.org/en/stable/how-to/captur
  e-warnings.html
```
[projects] Rename s/TestBaseNode/BaseTestNode to mute pytest warning
Move all FORGE-specific bootstrap logic (FournosJob fetch, env export,
PR checkout, kubeconfig setup, run_ci dispatch) from inline YAML bash
into a single bin/fournos_entrypoint script.

Both task-forge-step.yaml and resolve-job.yaml now simply invoke
command: ["/opt/fournos/entrypoint"] — no engine-specific bash in YAML.

The Containerfile installs yq and creates the /opt/fournos/entrypoint
symlink pointing to bin/fournos_entrypoint, satisfying the Fournos
execution-engine contract.

This is the FORGE-side counterpart to the Fournos multi-engine
decoupling work.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants