move sim components into connector folder

As part of this, drop the [SimPlatform] as part of the folder name. Too complicated to fix up references to it and unnecessary to give it a special name.
This commit is contained in:
Forrest Trepte 2021-11-17 21:55:37 -08:00
Родитель 3e6bf738d9
Коммит 50795eda71
7 изменённых файлов: 14 добавлений и 8 удалений

Просмотреть файл

Просмотреть файл

@ -1,3 +1,4 @@
# TODO: Delete this placeholder file and replace it with your actual simulator platform runtime components.
class Adder:
"""
Add numbers to a running total.

Просмотреть файл

Просмотреть файл

@ -1,4 +1,4 @@
from sim.adder import Adder
from connector.adder import Adder
from typing import NamedTuple, Dict, Any
class SimulatorModel:

Просмотреть файл

@ -2,14 +2,14 @@
# See Image Variants at https://hub.docker.com/_/python for information about different flavors of Python containers.
FROM python:3.7.4-slim
# Set up the simulator
WORKDIR /src
# Copy simulator files to /src
COPY . /src
# Copy connector and sample files to image
COPY ./connector ./connector
COPY ./samples/[SampleName] ./samples/[SampleName]
# Install simulator dependencies
RUN pip3 install -r requirements.txt
RUN pip3 install -r ./connector/requirements.txt
# This will be the command to run the simulator
CMD ["python3", "main.py"]
CMD python3 samples/ContosoUseCase/main.py

Просмотреть файл

@ -85,7 +85,7 @@ In the following commands, `<SUBSCRIPTION>` and `<WORKSPACE_ACR_PATH>` should be
[your workspace details](https://docs.microsoft.com/en-us/bonsai/cookbook/get-workspace-info):
```
docker build -t [SampleName]-container:latest -f Dockerfile .
docker build -t [SampleName]-container:latest -f Dockerfile ../..
docker tag [SampleName]-container:latest <WORKSPACE_ACR_PATH>/[SampleName]-container:latest
az acr login --subscription <SUBSCRIPTION> --name <WORKSPACE_ACR_PATH>
docker push <WORKSPACE_ACR_PATH>/[SampleName]-container:latest

Просмотреть файл

@ -2,9 +2,14 @@
import os
import time
import sys
from microsoft_bonsai_api.simulator.client import BonsaiClient, BonsaiClientConfig
from microsoft_bonsai_api.simulator.generated.models import SimulatorInterface, SimulatorState, SimulatorSessionResponse
from sim.simulator_model import SimulatorModel
# Add parent directory containing the connector folder to path.
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from connector.simulator_model import SimulatorModel
def main():
"""