ci: use elc-linux-amd64 from El repo, fix EL_HOME to lang/ across all workflows
This commit is contained in:
@@ -80,8 +80,7 @@ jobs:
|
|||||||
git clone --depth 1 \
|
git clone --depth 1 \
|
||||||
"https://will:${CHECKOUT_TOKEN}@git.neuralplatform.ai/neuron-technologies/el.git" \
|
"https://will:${CHECKOUT_TOKEN}@git.neuralplatform.ai/neuron-technologies/el.git" \
|
||||||
"$DEST"
|
"$DEST"
|
||||||
ls -la "$DEST" | head -5
|
echo "EL_HOME=$DEST/lang" >> "$GITHUB_ENV"
|
||||||
echo "EL_HOME=$DEST" >> "$GITHUB_ENV"
|
|
||||||
|
|
||||||
- name: Authenticate to GCP
|
- name: Authenticate to GCP
|
||||||
id: auth
|
id: auth
|
||||||
@@ -104,15 +103,12 @@ jobs:
|
|||||||
- name: Configure docker auth for Artifact Registry
|
- name: Configure docker auth for Artifact Registry
|
||||||
run: gcloud auth configure-docker us-central1-docker.pkg.dev --quiet
|
run: gcloud auth configure-docker us-central1-docker.pkg.dev --quiet
|
||||||
|
|
||||||
- name: Get elc (pre-built linux/amd64 from El SDK release)
|
- name: Get elc (pre-built linux/amd64 from El repo)
|
||||||
if: steps.changetype.outputs.asset_only != 'true'
|
if: steps.changetype.outputs.asset_only != 'true'
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
curl -fL -o "$EL_HOME/dist/platform/elc" \
|
chmod +x "$EL_HOME/dist/platform/elc-linux-amd64"
|
||||||
https://git.neuralplatform.ai/neuron-technologies/el/releases/download/v1.2.1/elc-linux-amd64
|
ln -sf "$EL_HOME/dist/platform/elc-linux-amd64" "$EL_HOME/dist/platform/elc"
|
||||||
chmod +x "$EL_HOME/dist/platform/elc"
|
|
||||||
file "$EL_HOME/dist/platform/elc"
|
|
||||||
ls -la "$EL_HOME/dist/platform/elc"
|
|
||||||
|
|
||||||
- name: Compute image tag
|
- name: Compute image tag
|
||||||
id: tag
|
id: tag
|
||||||
|
|||||||
@@ -34,36 +34,18 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
- name: Set up El SDK (build linux elc from repo C source)
|
- name: Set up El SDK
|
||||||
env:
|
env:
|
||||||
CHECKOUT_TOKEN: ${{ secrets.CHECKOUT_TOKEN }}
|
CHECKOUT_TOKEN: ${{ secrets.CHECKOUT_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Install curl dev libs — needed to link elc.c.
|
|
||||||
# ci-base has gcc but not libcurl4-openssl-dev.
|
|
||||||
sudo apt-get update -qq
|
|
||||||
sudo apt-get install -y -qq libcurl4-openssl-dev libssl-dev
|
|
||||||
|
|
||||||
DEST="${{ github.workspace }}/../foundation-el"
|
DEST="${{ github.workspace }}/../foundation-el"
|
||||||
|
git clone --depth=1 \
|
||||||
# Clone El repo for source files, runtime, and JS runtime
|
"https://will:${CHECKOUT_TOKEN}@git.neuralplatform.ai/neuron-technologies/el.git" \
|
||||||
git -c "http.extraheader=Authorization: token ${CHECKOUT_TOKEN}" clone \
|
|
||||||
--depth=1 \
|
|
||||||
"https://git.neuralplatform.ai/neuron-technologies/el.git" \
|
|
||||||
"$DEST"
|
"$DEST"
|
||||||
|
# Use the pre-built linux/amd64 binary — no C compilation needed in CI.
|
||||||
# Compile elc.c (committed C source of the El compiler) for linux/amd64.
|
chmod +x "$DEST/lang/dist/platform/elc-linux-amd64"
|
||||||
# The darwin arm64 binary at lang/dist/platform/elc can't run on linux.
|
ln -sf "$DEST/lang/dist/platform/elc-linux-amd64" "$DEST/lang/dist/platform/elc"
|
||||||
# Note: -lcurl -lpthread must come AFTER source files on gcc/linux.
|
|
||||||
cc -std=c11 -O2 \
|
|
||||||
-I "$DEST/lang/el-compiler/runtime" \
|
|
||||||
-o "$DEST/lang/dist/platform/elc" \
|
|
||||||
"$DEST/lang/dist/platform/elc.c" \
|
|
||||||
"$DEST/lang/el-compiler/runtime/el_runtime.c" \
|
|
||||||
-lcurl -lpthread
|
|
||||||
|
|
||||||
chmod +x "$DEST/lang/dist/platform/elc"
|
|
||||||
echo "EL_HOME=$DEST/lang" >> "$GITHUB_ENV"
|
echo "EL_HOME=$DEST/lang" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Authenticate to GCP
|
- name: Authenticate to GCP
|
||||||
@@ -84,9 +66,6 @@ jobs:
|
|||||||
run: echo "tag=dev-${GITHUB_SHA:0:8}" >> "$GITHUB_OUTPUT"
|
run: echo "tag=dev-${GITHUB_SHA:0:8}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Touch HTML placeholder files
|
- name: Touch HTML placeholder files
|
||||||
# El binary regenerates these at startup via fs_write. They must exist
|
|
||||||
# in the build context for Dockerfile COPY to succeed. touch is
|
|
||||||
# idempotent if the files already exist from a prior run.
|
|
||||||
run: touch src/index.html src/about.html src/terms.html src/enterprise-terms.html
|
run: touch src/index.html src/about.html src/terms.html src/enterprise-terms.html
|
||||||
|
|
||||||
- name: Build image (local only — no push)
|
- name: Build image (local only — no push)
|
||||||
@@ -104,8 +83,6 @@ jobs:
|
|||||||
-e LANDING_ROOT=/srv/landing \
|
-e LANDING_ROOT=/srv/landing \
|
||||||
"$IMAGE"
|
"$IMAGE"
|
||||||
|
|
||||||
# entrypoint.sh sleeps 4s for soul-demo to load before starting neuron-web.
|
|
||||||
# Poll up to 45s total.
|
|
||||||
for i in $(seq 1 15); do
|
for i in $(seq 1 15); do
|
||||||
STATUS=$(curl -sSo /dev/null -w "%{http_code}" --max-time 5 http://localhost:8080/ || echo "000")
|
STATUS=$(curl -sSo /dev/null -w "%{http_code}" --max-time 5 http://localhost:8080/ || echo "000")
|
||||||
echo "Attempt $i/15: HTTP $STATUS"
|
echo "Attempt $i/15: HTTP $STATUS"
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ jobs:
|
|||||||
git clone --depth 1 \
|
git clone --depth 1 \
|
||||||
"https://will:${CHECKOUT_TOKEN}@git.neuralplatform.ai/neuron-technologies/el.git" \
|
"https://will:${CHECKOUT_TOKEN}@git.neuralplatform.ai/neuron-technologies/el.git" \
|
||||||
"$DEST"
|
"$DEST"
|
||||||
echo "EL_HOME=$DEST" >> "$GITHUB_ENV"
|
echo "EL_HOME=$DEST/lang" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Authenticate to GCP
|
- name: Authenticate to GCP
|
||||||
uses: google-github-actions/auth@v2
|
uses: google-github-actions/auth@v2
|
||||||
@@ -97,19 +97,8 @@ jobs:
|
|||||||
if: steps.changetype.outputs.asset_only != 'true'
|
if: steps.changetype.outputs.asset_only != 'true'
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
# Copy the El C-compiler binary from the cloned El repo into the expected path.
|
chmod +x "$EL_HOME/dist/platform/elc-linux-amd64"
|
||||||
# The JS-capable elc for client-side compilation is committed in bin/elc-linux-amd64
|
ln -sf "$EL_HOME/dist/platform/elc-linux-amd64" "$EL_HOME/dist/platform/elc"
|
||||||
# and used automatically by build-stage.sh on linux/amd64.
|
|
||||||
ELC_SRC="$EL_HOME/dist/platform/elc-linux-amd64"
|
|
||||||
if [ -f "$ELC_SRC" ]; then
|
|
||||||
cp "$ELC_SRC" "$EL_HOME/dist/platform/elc"
|
|
||||||
chmod +x "$EL_HOME/dist/platform/elc"
|
|
||||||
else
|
|
||||||
# Fallback: download v1.2.1 C-compiler if the repo binary is absent
|
|
||||||
curl -fL -o "$EL_HOME/dist/platform/elc" \
|
|
||||||
https://git.neuralplatform.ai/neuron-technologies/el/releases/download/v1.2.1/elc-linux-amd64
|
|
||||||
chmod +x "$EL_HOME/dist/platform/elc"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Compute image tag
|
- name: Compute image tag
|
||||||
id: tag
|
id: tag
|
||||||
|
|||||||
Reference in New Issue
Block a user