Skip to content

Commit 3b7248f

Browse files
Clarify Docker Compose and E2E test context
-> Before the assumption around E2E tests using SAME_HOST was sort of hidden. (It was declared in E2E file, but the meaning of that depended on the prior version of dispatcher) -> Clarify the assumption that `testing_e2e` will use baremetal ingress -> Clarify the "Docker" one is ACTUALLY "Docker Compose" which is a specific implementation/usage of Docker -> Another option could be to specify which ingress is used in the env file directly. Although in this case the confusion was more the lack of any definition around E2E in this context.
1 parent 609652f commit 3b7248f

2 files changed

Lines changed: 14 additions & 10 deletions

File tree

.github/workflows/e2e_tests.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
DIFFGRAM_SYSTEM_MODE: testing_e2e
2525
GOOGLE_APPLICATION_CREDENTIALS: /gcp/gcloud-service-key.json
2626
DIFFGRAM_STATIC_STORAGE_PROVIDER: minio
27-
SAME_HOST: True
2827
IS_DIFFGRAM_S3_V4_SIGNATURE: True
2928
DIFFGRAM_S3_BUCKET_NAME: foo
3029
DIFFGRAM_MINIO_ACCESS_KEY_ID: root
@@ -36,7 +35,7 @@ jobs:
3635
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
3736
SERVICE_ACCOUNT_FULL_PATH: /gcp/gcloud-service-key.json
3837
DIFFGRAM_HOST_OS: ${{ secrets.DIFFGRAM_HOST_OS }}
39-
DIFFGRAM_VERSION_TAG: 0.0.1
38+
DIFFGRAM_VERSION_TAG: Testing
4039
DIFFGRAM_INSTALL_FINGERPRINT: ${{ secrets.DIFFGRAM_INSTALL_FINGERPRINT }}
4140
USER: root
4241
RUNNER_ALLOW_RUNASROOT: true
@@ -144,7 +143,6 @@ jobs:
144143
DIFFGRAM_STATIC_STORAGE_PROVIDER: minio
145144
DIFFGRAM_S3_BUCKET_NAME: testbucket
146145
ML__DIFFGRAM_S3_BUCKET_NAME: testbucket
147-
SAME_HOST: True
148146
IS_DIFFGRAM_S3_V4_SIGNATURE: True
149147
DIFFGRAM_MINIO_ACCESS_KEY_ID: minioadmin
150148
DIFFGRAM_MINIO_ACCESS_KEY_SECRET: minioadmin

local_dispatcher/local_dispatch.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ def __init__(self, host='http://127.0.0.1'):
151151
static_folder = "../frontend/dist/static")
152152

153153

154-
class DockerIngress(Ingress):
154+
class DockerComposeIngress(Ingress):
155155
def __init__(self, host=None):
156156
super().__init__(host)
157157

158-
self.name = "docker"
158+
self.name = "Docker Compose"
159159

160160
self.default.host = 'http://default'
161161
self.walrus.host = 'http://walrus'
@@ -196,12 +196,18 @@ def start(self):
196196

197197

198198

199-
DOCKER_CONTEXT = env_adapter.bool(os.getenv('DOCKER_CONTEXT', False))
199+
def determine_ingress_from_env():
200+
DOCKER_CONTEXT = env_adapter.bool(os.getenv('DOCKER_CONTEXT', False))
201+
DIFFGRAM_SYSTEM_MODE = os.getenv('DIFFGRAM_SYSTEM_MODE', None)
200202

201-
if DOCKER_CONTEXT is True:
202-
ingress = DockerIngress()
203-
else:
204-
ingress = BaremetalIngress()
203+
ingress = BaremetalIngress() # Default
204+
205+
if DIFFGRAM_SYSTEM_MODE != 'testing_e2e':
206+
if DOCKER_CONTEXT is True:
207+
ingress = DockerComposeIngress()
208+
209+
return ingress
205210

211+
ingress = determine_ingress_from_env()
206212
router = Router(ingress)
207213
router.start()

0 commit comments

Comments
 (0)