Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3.8'

services:
hypha:
build: .
image: amun-ai/hypha
container_name: hypha
command: --port 9520 --host=0.0.0.0
Copy link

@enolfc enolfc Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be more like the CMD in the Dockerfile ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are right, we have it already

CMD ["python", "-m", "hypha.server", "--host=0.0.0.0", "--port=9520"]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah the entry point in the dockerfile has it already. This PR was going to add in the permissions fix as well, but I believe @oeway fixed that already during the time this PR has been open. I've rebased on the main branch and now this PR is mostly trying to put some container testing in place.

I'm now just checking to see if bumping the hypha version downstream fixes the permissions issues.

P.s
I think the default port on the original server this ran on was 9000 and that then became the port for the k8s cluster etc etc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ctr26 I think the latest one should work for non-privileged rancher cluster, we have tested it with the helm chart included in the repo: https://github.com/amun-ai/hypha/tree/main/helm-charts

So maybe we can close this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I saw that you tried to fix the permission. I'm now updating the bioengine image with the newest hypha to make the egi stuff work.

I think it's a good idea for the docker image testing that I've put here to still be added as it'll be useful for the future.

But otherwise this PR is now rebased to use your dockerfile

ports:
- 9520:9520
11 changes: 11 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
channels:
- anaconda
- conda-forge
- defaults
dependencies:
- python=3.10
- conda-forge::minio
- pip
- pip:
- playwright
- -e .[server-apps]
1 change: 1 addition & 0 deletions requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ requests==2.31.0
websocket-client==1.6.1
nvidia-pytriton==0.2.1; python_version == '3.8'
simpervisor==1.0.0
testcontainers
35 changes: 35 additions & 0 deletions tests/test_containers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from testcontainers.compose import DockerCompose
import requests
import time


def test_server_response():
compose = DockerCompose(
"./"
) # Assuming docker-compose.yml is in the same directory
print(compose)

with compose:
# Wait a few seconds for the server to be up
time.sleep(5)

# Docker Compose typically uses the service name as the hostname
host, port = compose.get_service_host_and_port("hypha", 9520)

# Construct the URL to test
url = f"http://{host}:{port}"

result_current_dir = compose.exec_in_container(["touch", "test"])

# assert result_current_dir.exit_code == 0

result_tmp = compose.exec_in_container(["touch", "/tmp/test"])

# assert result_tmp.exit_code == 0

print("Write tests passed successfully!")
response = requests.get(url)
if response.status_code == 200:
print("Server responded successfully!")
else:
print(f"Server responded with status code: {response.status_code}")
Loading