mirror of
https://github.com/floci-io/floci.git
synced 2026-11-26 15:21:05 -05:00
feat(emr-containers): run a managed endpoint's overridden kernels in containers of their own (#9293)
An endpoint's jupyter-kernel-overrides gives a kernel its own
container-image ("Custom kernel image with interactive endpoint"), and
on EMR on EKS each kernel is a pod of its image. A Floci endpoint ran
every kernel in its gateway's container, whatever image the overrides
named.
- The gateway job tells the gateway program which kernels the
overrides give an image (python3 and spark-python-kubernetes, the
kernels the guide's example names, as "You can't add new kernel image
types"), where it asks Floci for their containers, and a secret Floci
gives that gateway alone.
- EmrContainersKernelContainersRoute takes the gateway's POST and
DELETE on /_aws/emr-containers/kernel-containers/<endpoint>/<kernel>.
The service checks the secret, that the endpoint is ACTIVE and its
overrides give the kernel an image, and the kernel id, response
address and public key, then EmrContainersKernelContainers runs the
kernel's container: the override image, with the gateway's settings
and environment and the kernel's KERNEL_ variables, running the
image's Jupyter Enterprise Gateway launcher (launch_ipykernel.py),
under spark-submit with the %%configure magic for a PySpark kernel.
A launch is admitted under the lock the gateway's end takes, so an
endpoint's kernel containers all stop with its gateway, and a reset
or Floci's shutdown stops every one.
- The gateway program gives such a kernel a jupyter_client provisioner
that speaks the launcher's protocol: it asks Floci for the container
with an RSA public key and a response address, decrypts the
connection the launcher sends back (an AES key, under RSA, over
AES-GCM), and polls, signals and stops the kernel through the
launcher's comm port and Floci. It waits KERNEL_LAUNCH_TIMEOUT
seconds, at most the guide's 400, or 400, and a launch that fails
once the container was asked for stops it.
- Such a kernel's %%configure magic posts to its ENDPOINT_IP, the
gateway, on port 9547 over TLS, with a certificate the image's openssl
makes; the program checks it with the launcher's AES key, which each
launch refreshes. Every restart, the kernels API's, the
auto-restarter's or %%configure's, gives the kernel a new container
with new ports and a new key, and the program moves the kernel's
clients and its activity watch onto them.
- The nightly check gains a method: an endpoint that overrides both
kernels with the release's own image runs each in its own container,
the PySpark one counting an S3 file's lines and taking %%configure.
The docker-runner group's budget grows by its eighteen minutes.
This commit is contained in:
1 parent
8724146f3f
commit
0dd02aed44
10 files changed
+1143
-32
No files matched your search
@@ -34,9 +34,9 @@ jobs:
|
||||
# EmrDockerRunnerNightlyIntegrationTest's eleven two-minute tests and two-minute setup,
|
||||
# EmrClusterShrinkNightlyIntegrationTest's sixteen-minute method and two-minute setup, and
|
||||
# EmrContainersSparkNightlyIntegrationTest's three six-minute methods, eleven-minute method, two-minute setup before
|
||||
# each and 21-minute image pull, and EmrContainersGatewayNightlyIntegrationTest's twenty-minute and seven-minute
|
||||
# methods and 21-minute image pull, 148 minutes. A check added, or a bound raised, raises its group's timeout with
|
||||
# it, so a slow check fails with its own message.
|
||||
# each and 21-minute image pull, and EmrContainersGatewayNightlyIntegrationTest's twenty-minute, seven-minute and
|
||||
# eighteen-minute methods and 21-minute image pull, 166 minutes. A check added, or a bound raised, raises its
|
||||
# group's timeout with it, so a slow check fails with its own message.
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
- group: standard
|
||||
timeout: 359
|
||||
- group: docker-runner
|
||||
timeout: 168
|
||||
timeout: 186
|
||||
timeout-minutes: ${{ matrix.timeout }}
|
||||
# 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.
|
||||
|
||||
Reference in new issue
Block a user