mirror of
https://github.com/floci-io/floci.git
synced 2026-12-06 11:38:06 -05:00
With runner-mode docker, GetOnClusterAppUIPresignedURL now opens the interfaces that run on the cluster's primary node for real: its ResourceManager, an application master through the ResourceManager's web proxy, its MapReduce JobHistory server, and the NodeManager of a primary node that works. Each opens on a host of its own, as AWS's application UIs do under emrappui-prod.<region>.amazonaws.com, which are on the Public Suffix List: http://<secret>-<port>.emrappui.<Floci's host and port>/, the secret 26 random base32 characters only the link holds, so the host is the link's authority, as the interface takes no AWS credentials. EmrAppUiProxy, a Vert.x route ahead of the REST layer, sends a request to that host on to the node's port, which the primary node publishes on the host's loopback interface (Floci in a container joins the cluster's network instead). It asks the interface under the browser's host, so the links the interface writes itself are the browser's, and makes each link the node's daemons write to one another by the node's name a link to that interface's own host under the same secret, in text answers and Location headers; an answer too large to hold goes on unchanged. A request's body streams on as it arrives, an interface that sends nothing for a minute has the request given up, and a link of a cluster that has ended opens nothing, the node's port it found asked for again every ten seconds while the cluster runs. A link asked for before the primary node runs, as on a cluster no step has run on yet, starts the node as a step would, through runOnCluster, running nothing, and is not PresignedURLReady until the node is; its host answers 503 meanwhile. With an ApplicationId each interface lands on the application's page. The link lasts an hour, as Floci's page links do. An interface Floci does not run (the Spark History Server, the YARN timeline server, the Tez UI), and any link in the immediate mode, still opens Floci's own page. Floci's TLS certificate names *.emrappui.localhost and *.emrappui.localhost.floci.io. Lambda's CreateFunction and UpdateFunctionCode now refuse a direct ZipFile upload over 50 MB from its Base64 length, before decoding it, so a request already over the limit takes no more memory than it came in; its RequestEntityTooLargeException is as before, and the test of it builds its oversized upload without the bytes behind it. EmrAppUiNightlyIntegrationTest runs it for real on an emr-7.5.0 cluster: the ResourceManager's link starts the primary node and opens the ResourceManager, and after a MapReduce step its REST answer's links open the application master's logs on the NodeManager's host and, through the web proxy's redirect, the job on the JobHistory server's host, as the JobHistory server's own link does. The nightly job's timeout and image prefetch take the new check.
134 lines
6.1 KiB
YAML
134 lines
6.1 KiB
YAML
name: Nightly checks
|
|
|
|
# Runs the test classes named *NightlyIntegrationTest: checks that pull or push images too large, or run too long,
|
|
# for every pull request's shards. Each such class skips unless the JVM has -Dnightly.checks.enabled=true, so the
|
|
# CI shards, which pick every *Test class, see it skip at no cost; this workflow sets the property. Its name is
|
|
# outside floci.*, whose names Floci's configuration validates: a Quarkus test given -Dfloci.nightly refuses to
|
|
# start. It runs once a day on main, on demand, and on a pull request that adds or changes a nightly check, so the
|
|
# check is seen to pass before it merges. GitHub-hosted runners only, which a public repository runs at no charge.
|
|
on:
|
|
schedule:
|
|
# 08:00 UTC, after Nightly (23:00 America/Chicago) and away from the daytime merges' CI runs.
|
|
- cron: '0 8 * * *'
|
|
workflow_dispatch:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened, ready_for_review]
|
|
paths:
|
|
- '.github/workflows/nightly-checks.yml'
|
|
- 'src/test/java/**/*NightlyIntegrationTest.java'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
jobs:
|
|
checks:
|
|
name: Nightly checks
|
|
runs-on: ubuntu-latest
|
|
# The checks run one after another, each within its own @Timeout bounds, so the job allows their sum, and about
|
|
# twenty minutes for the build, the image and the prefetch: EmrPigStepsNightlyIntegrationTest's 30,
|
|
# EmrFlociContainerNightlyIntegrationTest's 20 and 4 for its setup,
|
|
# EmrServerlessCustomImageNightlyIntegrationTest's 85 and 21 for its setup,
|
|
# EmrServerlessSparkConnectNightlyIntegrationTest's 30, EmrSessionServerNightlyIntegrationTest's 40,
|
|
# EmrHiveStepsNightlyIntegrationTest's five two-minute tests, one five-minute test and six-minute setup,
|
|
# EmrNotebookExecutionNightlyIntegrationTest's 40, and EmrAppUiNightlyIntegrationTest's 30, 321 in all. A check
|
|
# added, or a bound raised, raises this with it, so a slow check fails with its own message rather than the job
|
|
# being cancelled with none.
|
|
timeout-minutes: 341
|
|
# A fork's schedule would spend its owner's minutes on checks it never asked for; a draft waits until it is
|
|
# ready for review, as the CI shards do.
|
|
if: >-
|
|
(github.event_name != 'schedule' || !github.event.repository.fork) &&
|
|
(github.event_name != 'pull_request' || github.event.pull_request.draft == false)
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
|
|
# Every test is a top-level class in src/test/java, so the file name is the class name, as ci.yml relies on.
|
|
- name: List the nightly checks
|
|
id: list
|
|
run: |
|
|
cd src/test/java
|
|
find . -name '*NightlyIntegrationTest.java' | sed 's|^\./||; s|\.java$||' | LC_ALL=C sort \
|
|
> "$GITHUB_WORKSPACE/nightly.txt"
|
|
cd "$GITHUB_WORKSPACE"
|
|
count=$(wc -l < nightly.txt | tr -d ' ')
|
|
echo "count=$count" >> "$GITHUB_OUTPUT"
|
|
echo "$count nightly checks"
|
|
cat nightly.txt
|
|
|
|
- name: No nightly checks yet
|
|
if: steps.list.outputs.count == '0'
|
|
run: echo "::notice title=Nightly checks::No *NightlyIntegrationTest class exists, so nothing ran."
|
|
|
|
# The checks' images run to several gigabytes, a pushed copy of one included, and the runner's disk holds
|
|
# toolchains they never use.
|
|
- name: Free disk space
|
|
if: steps.list.outputs.count != '0'
|
|
run: |
|
|
df -h /
|
|
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
|
|
df -h /
|
|
|
|
- uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
|
|
if: steps.list.outputs.count != '0'
|
|
with:
|
|
java-version: '25'
|
|
distribution: 'temurin'
|
|
# no `cache: maven`, as in ci.yml; main's cache is restored below.
|
|
|
|
# Restored only: ci.yml saves main's copy under this key.
|
|
- uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
if: steps.list.outputs.count != '0'
|
|
with:
|
|
path: ~/.m2/repository
|
|
key: maven-${{ runner.os }}-${{ hashFiles('pom.xml') }}
|
|
restore-keys: |
|
|
maven-${{ runner.os }}-
|
|
|
|
- name: Prefetch the checks' Docker images (background)
|
|
if: steps.list.outputs.count != '0'
|
|
run: .github/ci/prefetch-images.sh nightly.txt || true
|
|
|
|
- name: Compile
|
|
if: steps.list.outputs.count != '0'
|
|
run: ./mvnw test-compile -B
|
|
|
|
# A check that runs Floci in a container, as a user's Docker setup does, runs this image: this commit's own
|
|
# build, made from the compiled application as docker/Dockerfile.jvm-package describes.
|
|
- name: Build the Floci image
|
|
if: steps.list.outputs.count != '0'
|
|
run: |
|
|
./mvnw package -B -q -DskipTests
|
|
docker build -q -f docker/Dockerfile.jvm-package -t floci/floci:nightly-check .
|
|
|
|
# nightly.txt is never empty here: an empty includesFile would make surefire run the whole suite.
|
|
- name: Run the nightly checks
|
|
if: steps.list.outputs.count != '0'
|
|
run: >
|
|
./mvnw surefire:test -B
|
|
-Dsurefire.includesFile="$GITHUB_WORKSPACE/nightly.txt"
|
|
-Dsurefire.failIfNoTests=true
|
|
-Dnightly.checks.enabled=true
|
|
-Dnightly.checks.floci-image=floci/floci:nightly-check
|
|
|
|
- name: Image prefetch results
|
|
if: always() && steps.list.outputs.count != '0'
|
|
run: |
|
|
cat prefetch-images.log 2>/dev/null || echo "no prefetch log"
|
|
grep -E 'stale prefetch key|prefetch skipped|prefetch failed' prefetch-images.log 2>/dev/null \
|
|
| sed 's/^/::warning title=prefetch-images.sh::/' || true
|
|
|
|
- name: Upload the checks' results
|
|
if: always() && steps.list.outputs.count != '0'
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: nightly-checks
|
|
path: |
|
|
nightly.txt
|
|
prefetch-images.log
|
|
target/surefire-reports/
|
|
if-no-files-found: warn
|