Skip to content

Commit

Permalink
Merge pull request #197 from Datura-ai/main
Browse files Browse the repository at this point in the history
deploy - validator 3.4.1
  • Loading branch information
talentwebdev authored Jan 20, 2025
2 parents b7b875e + 978a0f0 commit 117dd40
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 11 deletions.
7 changes: 4 additions & 3 deletions neurons/executor/.env.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
INTERNAL_PORT=8001
EXTERNAL_PORT=8001
INTERNAL_PORT=8001 # interal port of docker
EXTERNAL_PORT=8001 # external port of docker

SSH_PORT=2200
SSH_PORT=2200 # external ssh port of docker map into 22
SSH_PUBLIC_PORT=2200 # Optional. in case you are using proxy and public port is different from internal port in your server

# NOTE: please use either RENTING_PORT_RANGE or RENTING_PORT_MAPPINGS, both are not allowed
# Note: If you are not using proxy and all ports are available publicly,
Expand Down
2 changes: 1 addition & 1 deletion neurons/executor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ RUN mkdir -p /etc/docker
RUN mkdir -p /etc/nvidia-container-runtime
RUN mkdir -p /root/.ssh

LABEL version="3.3.2"
LABEL version="3.3.3"

CMD ["bash", "run.sh"]
2 changes: 1 addition & 1 deletion neurons/executor/Dockerfile.runner
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ COPY entrypoint.sh /entrypoint.sh

RUN chmod u+x /entrypoint.sh

LABEL version="3.3.2"
LABEL version="3.3.3"

ENTRYPOINT ["/entrypoint.sh"]
3 changes: 2 additions & 1 deletion neurons/executor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ You can change the ports for `INTERNAL_PORT`, `EXTERNAL_PORT`, `SSH_PORT` based

- **INTERNAL_PORT**: internal port of your executor docker container
- **EXTERNAL_PORT**: external expose port of your executor docker container
- **SSH_PORT**: ssh access port of your executor docker container
- **SSH_PORT**: ssh port map into 22 of your executor docker container
- **SSH_PUBLIC_PORT**: [Optional] ssh public access port of your executor docker container. If `SSH_PUBLIC_PORT` is equal to `SSH_PORT` then you don't have to specify this port.
- **MINER_HOTKEY_SS58_ADDRESS**: the miner hotkey address
- **RENTING_PORT_RANGE**: The port range that are publicly accessible. This can be empty if all ports are open. Available formats are:
- Range Specification(`from-to`): Miners can specify a range of ports, such as 2000-2005. This means ports from 2000 to 2005 will be open for the validator to select.
Expand Down
3 changes: 2 additions & 1 deletion neurons/executor/src/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ class Settings(BaseSettings):
PROJECT_NAME: str = "compute-subnet-executor"

INTERNAL_PORT: int = Field(env="INTERNAL_PORT", default=8001)
SSH_PORT: int = Field(env="SSH_PORT", default=22)
SSH_PORT: int = Field(env="SSH_PORT", default=2200)
SSH_PUBLIC_PORT: Optional[int] = Field(env="SSH_PUBLIC_PORT", default=None)

MINER_HOTKEY_SS58_ADDRESS: str = Field(env="MINER_HOTKEY_SS58_ADDRESS")

Expand Down
2 changes: 1 addition & 1 deletion neurons/executor/src/services/miner_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def upload_ssh_key(self, paylod: MinerAuthPayload):

return {
"ssh_username": self.ssh_service.get_current_os_user(),
"ssh_port": settings.SSH_PORT,
"ssh_port": settings.SSH_PUBLIC_PORT or settings.SSH_PORT,
"python_path": sys.executable,
"root_dir": str(Path(__file__).resolve().parents[2]),
"port_range": settings.RENTING_PORT_RANGE,
Expand Down
2 changes: 1 addition & 1 deletion neurons/validators/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ RUN echo "export PYTHONPATH=$PYTHONPATH" >> ~/.bash_profile
COPY --from=base-image /root/app/ /root/app/
COPY --from=base-image /opt/pypackages/ /opt/pypackages/

LABEL version="3.4.0"
LABEL version="3.4.1"

CMD ["bash", "run.sh"]
2 changes: 1 addition & 1 deletion neurons/validators/Dockerfile.runner
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ WORKDIR /root/validator
COPY docker-compose.app.yml docker-compose.yml
COPY entrypoint.sh /entrypoint.sh

LABEL version="3.4.0"
LABEL version="3.4.1"

RUN chmod u+x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
3 changes: 2 additions & 1 deletion neurons/validators/src/services/task_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async def is_script_running(

async def start_script(
self,
ssh_client,
ssh_client: asyncssh.SSHClientConnection,
script_path: str,
command_args: dict,
executor_info: ExecutorSSHInfo,
Expand All @@ -124,6 +124,7 @@ async def start_script(
try:
# Build command string from arguments
args_string = " ".join([f"--{key} {value}" for key, value in command_args.items()])
await ssh_client.run("pip install aiohttp click pynvml psutil", timeout=30)
command = (
f"nohup {executor_info.python_path} {script_path} {args_string} > /dev/null 2>&1 & "
)
Expand Down

0 comments on commit 117dd40

Please sign in to comment.