diff --git a/FogNode/README.md b/FogNode/README.md index c57e7ce..1ccafb5 100644 --- a/FogNode/README.md +++ b/FogNode/README.md @@ -47,6 +47,9 @@ Lastly, start the container services via Docker Compose: - On Linux, execute `docker compose --platform=linux up` to start the service, use the `-d` flag to run it in the background like: `docker compose --platform=linux up -d`. The service is automatically advertised by Avahi via mDNS from the Docker service. - On macOS, run `docker compose up` to start the service. In addition, because of technical limitations of Avahi within a Docker container on macOS, one has to manually run the mDNS advertisement via Bonjour: `dns-sd -R "SpeziLLMFog Service" _https._tcp spezillmfog.local 443`. It advertises the service under the `spezillmfog.local` domain name with the `"SpeziLLMFog Service"` user-friendly name. -#### Development +### Development -For development purposes, the `docker-compose.dev.yml` file starts up the fog node without TLS certificates and with the usage of the Firebase Emulator. In that case, one doesn't have to execute the setup script mentioned above (as no certificates are required without a TLS connection) and doesn't have to get the Firebase service account key from the Firebase Console. +For development purposes, the `docker-compose.dev.yml` file starts up the fog node without TLS certificates and with the usage of the Firebase Emulator. In that case, one doesn't have to execute the setup script mentioned above (as no certificates are required without a TLS connection) and doesn't have to get the Firebase service account key from the Firebase Console. +In addition, this development compose file doesn't include an mDNS advertisement service. The developer is responsible for advertising the service. On macOS, which is the primary development environment for SpeziLLMFog, this can be done via Bonjour and the `dns-sd -R "SpeziLLMFog Service" _http._tcp spezillmfog.local 80` command. Note that the service advertises an `http` service with port 80, in contrast to the production setup with HTTPS and port 443 (secure traffic). + +Another file for development purposes is the `docker-compose.avahi.yml` file. One container advertises an mDNS service via Avahi, another container discovers this service via an Avahi Sidecar. This setup is incredibly useful to test mDNS announcements on the Linux platform. \ No newline at end of file diff --git a/FogNode/docker-compose.avahi.yml b/FogNode/docker-compose.avahi.yml new file mode 100644 index 0000000..1100ad3 --- /dev/null +++ b/FogNode/docker-compose.avahi.yml @@ -0,0 +1,31 @@ +# +# This source file is part of the Stanford Spezi open source project +# +# SPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +version: '3.8' +services: + # Advertises dummy mDNS service to sidecar container + avahi: + build: + context: avahi + hostname: spezillmfog.local + networks: + - avahi + + # Receives advertised dummy mDNS service from avahi container + avahi-sidecar: + build: + context: avahi + dockerfile: Dockerfile-Sidecar + hostname: spezillmfog-sidecar.local + networks: + - avahi + +# Enables to bridge mDNS advertise packages between the two avahi containers +networks: + avahi: + driver: bridge \ No newline at end of file diff --git a/FogNode/docker-compose.dev.yml b/FogNode/docker-compose.dev.yml index 4da4c75..c36011d 100644 --- a/FogNode/docker-compose.dev.yml +++ b/FogNode/docker-compose.dev.yml @@ -84,30 +84,10 @@ services: networks: - web - # Advertises dummy mDNS service to sidecar container - # avahi: - # build: - # context: avahi - # hostname: spezillmfog.local - # networks: - # - avahi - - # Receives advertised dummy mDNS service from avahi container - # avahi-sidecar: - # build: - # context: avahi - # dockerfile: Dockerfile-Sidecar - # hostname: spezillmfog-sidecar.local - # networks: - # - avahi - # Enables persistence of downloaded LLMs by Ollama volumes: ollama_storage: -# Enables to bridge mDNS advertise packages between the two avahi containers networks: - avahi: - driver: bridge web: driver: bridge diff --git a/Tests/UITests/TestAppUITests/TestAppLLMOpenAIUITests.swift b/Tests/UITests/TestAppUITests/TestAppLLMOpenAIUITests.swift index d8b6787..3718763 100644 --- a/Tests/UITests/TestAppUITests/TestAppLLMOpenAIUITests.swift +++ b/Tests/UITests/TestAppUITests/TestAppLLMOpenAIUITests.swift @@ -36,7 +36,11 @@ class TestAppLLMOpenAIUITests: XCTestCase { XCTAssert(app.buttons["Next"].waitForExistence(timeout: 2)) app.buttons["Next"].tap() + #if !os(visionOS) app.pickers["modelPicker"].pickerWheels.element(boundBy: 0).adjust(toPickerWheelValue: "GPT 4 Turbo Preview") + #else + app.pickers["modelPicker"].pickerWheels.element(boundBy: 0).swipeUp() + #endif XCTAssert(app.pickerWheels["GPT 4 Turbo Preview"].waitForExistence(timeout: 2)) sleep(1)