diff --git a/Makefile b/Makefile deleted file mode 100644 index 3137234a..00000000 --- a/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -SHELL := /bin/bash - -clean: - @cd docker; docker compose down - -network-test: - @cd docker; docker compose up --build --detach - @echo "network test running" - -logs: - @cd docker; docker compose logs --follow - -bash: - @cd docker; docker compose exec ait-server bash diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index 9a1cebb4..00000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,103 +0,0 @@ -# FROM redhat/ubi8:latest - -# ENV LOG_LEVEL=INFO -# ARG USER=ait -# ARG GROUP=ait -# ARG UID=1001 -# ARG GID=1001 -# ARG HOME=/home/$USER -# ENV PROJECT_HOME=/home/$USER - -# RUN dnf install -y python3.9 python3-pip \ -# && yum install -y nc \ -# && groupadd -r -g ${GID} ${GROUP} \ -# && useradd -m -u ${UID} -g ${GROUP} ${USER} - -# USER ait -# WORKDIR $PROJECT_HOME -# COPY --chown=${USER}:${GROUP} . $PROJECT_HOME/AIT-Core -# RUN python3.9 -m pip install --user --upgrade pip setuptools virtualenvwrapper virtualenv poetry \ -# && echo 'export PATH="${PROJECT_HOME}/.local/bin:$PATH"' >> ~/.bashrc \ -# && echo 'export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3.9' >> ~/.bashrc \ -# && echo 'export WORKON_HOME=${PROJECT_HOME}/.virtualenvs' >> ~/.bashrc \ -# && echo 'export PROJECT_HOME=${PROJECT_HOME}' >> ~/.bashrc \ -# && echo 'export VIRTUALENVWRAPPER_VIRTUALENV=${PROJECT_HOME}/.local/bin/virtualenv' >> ~/.bashrc \ -# && echo 'source ${PROJECT_HOME}/.local/bin/virtualenvwrapper.sh' >> ~/.bashrc \ -# && source ~/.bashrc \ -# && cd $PROJECT_HOME \ -# && echo 'if [ $VIRTUAL_ENV == "${PROJECT_HOME}/.virtualenvs/ait" ]; then' >> $PROJECT_HOME/.virtualenvs/postactivate \ -# && echo 'export AIT_ROOT=${PROJECT_HOME}/AIT-Core' >> $PROJECT_HOME/.virtualenvs/postactivate \ -# && echo 'export AIT_CONFIG=${PROJECT_HOME}/AIT-Core/docker/network-test-config.yaml' >> $PROJECT_HOME/.virtualenvs/postactivate \ -# && echo 'fi' >> $PROJECT_HOME/.virtualenvs/postactivate \ -# && cd AIT-Core \ -# && mkvirtualenv ait \ -# && poetry install -# ENTRYPOINT ["/usr/bin/bash","-c"] -# CMD ["source /home/ait/.bashrc && cd AIT-Core && workon ait && ait-server"] -#CMD ["sleep infinity"] - - -FROM redhat/ubi8:latest - -ENV LOG_LEVEL=INFO -ENV POETRY_VIRTUALENVS_CREATE=false -ENV PROJECT_HOME=/AIT-Core - -RUN dnf install -y python3.9 python3-pip \ - && yum install -y nc \ - && ln -sf /usr/bin/python3.9 /usr/bin/python - -WORKDIR $PROJECT_HOME -RUN python3.9 -m pip install --upgrade pip setuptools poetry -COPY poetry.lock pyproject.toml $PROJECT_HOME/ - -# Cache the install of all deps except for the root module -WORKDIR $PROJECT_HOME/ -RUN poetry install --no-interaction --no-ansi --no-root - -WORKDIR $PROJECT_HOME -COPY ait $PROJECT_HOME/ait -COPY config $PROJECT_HOME/config -COPY doc $PROJECT_HOME/doc -COPY docker $PROJECT_HOME/docker -COPY openmct $PROJECT_HOME/openmct -COPY poetry_cli $PROJECT_HOME/poetry_cli -COPY scripts $PROJECT_HOME/scripts -COPY sequences $PROJECT_HOME/sequences -COPY README.rst $PROJECT_HOME/ -COPY setup.cfg $PROJECT_HOME/tests -RUN echo 'export AIT_ROOT=${PROJECT_HOME}' >> ~/.bashrc \ - && echo 'export AIT_CONFIG=${PROJECT_HOME}/docker/network-test-config.yaml' >> ~/.bashrc \ - && echo 'export POETRY_VIRTUALENVS_CREATE=false' >> ~/.bashrc \ - && poetry install --no-interaction --no-ansi -ENTRYPOINT ["/usr/bin/bash","-c"] -#CMD ["source ~/.bashrc && ait-server"] - -# FROM redhat/ubi8:latest - -# ENV LOG_LEVEL=INFO -# ENV PROJECT_HOME=/AIT-Core -# ENV POETRY_VIRTUALENVS_CREATE=false -# RUN dnf install -y python3.9 python3-pip \ -# && yum install -y nc \ -# && ln -sf /usr/bin/python3.9 /usr/bin/python - -# WORKDIR $PROJECT_HOME -# RUN python3.9 -m pip install --upgrade pip setuptools poetry -# COPY poetry.lock pyproject.toml $PROJECT_HOME/ - -# # Cache the install of all deps except for the root module -# WORKDIR $PROJECT_HOME -# RUN poetry install --no-interaction --no-ansi --no-root - -# WORKDIR $PROJECT_HOME -# COPY ait $PROJECT_HOME/ait -# COPY docker $PROJECT_HOME/docker -# COPY scripts $PROJECT_HOME/scripts -# COPY config $PROJECT_HOME/config -# RUN echo 'export PATH="${PROJECT_HOME}/.local/bin:$PATH"' >> ~/.bashrc \ -# && echo 'export AIT_ROOT=${PROJECT_HOME}' >> ~/.bashrc \ -# && echo 'export AIT_CONFIG=${PROJECT_HOME}/docker/network-test-config.yaml' >> ~/.bashrc \ -# && echo 'export POETRY_VIRTUALENVS_CREATE=false' >> ~/.bashrc \ -# && poetry install --no-interaction --no-ansi -# ENTRYPOINT ["/usr/bin/bash","-c"] diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml deleted file mode 100644 index b256b38f..00000000 --- a/docker/docker-compose.yaml +++ /dev/null @@ -1,91 +0,0 @@ -services: - ait-server: - container_name: ait-server - platform: linux/amd64 - build: - context: ../ - dockerfile: ./docker/Dockerfile - depends_on: [tcp-server-send, tcp-server, udp-server] - command: ["source ~/.bashrc && ait-server"] - environment: - LOG_LEVEL: INFO - networks: - - ait - - # tcp-client: - # container_name: tcp-client - # platform: linux/amd64 - # build: - # context: ../ - # dockerfile: ./docker/Dockerfile - # depends_on: [ait-server] - # command: ["source /home/ait/.bashrc && cd AIT-Core && workon ait && python scripts/network_tester.py client TCP ait-server 1234"] - # networks: - # - ait - - udp-client-1: - container_name: udp-client-1 - platform: linux/amd64 - build: - context: ../ - dockerfile: ./docker/Dockerfile - depends_on: [ait-server] - command: ["source ~/.bashrc && python scripts/network_tester.py client UDP ait-server 1234"] - networks: - - ait - - tcp-client-2: - container_name: tcp-client-2 - platform: linux/amd64 - build: - context: ../ - dockerfile: ./docker/Dockerfile - depends_on: [ait-server] - command: ["source ~/.bashrc && python scripts/network_tester.py client TCP ait-server 1235"] - networks: - - ait - - # udp-client-2: - # container_name: udp-client-2 - # platform: linux/amd64 - # build: - # context: ../ - # dockerfile: ./docker/Dockerfile - # depends_on: [ait-server] - # command: ["source ~/.bashrc && python scripts/network_tester.py client UDP ait-server 1235"] - # networks: - # - ait - - tcp-server: - container_name: tcp-server - platform: linux/amd64 - build: - context: ../ - dockerfile: ./docker/Dockerfile - command: ["source ~/.bashrc && python -u scripts/network_tester.py server TCP 0.0.0.0 1237"] - networks: - - ait - - tcp-server-send: - container_name: tcp-server-send - platform: linux/amd64 - build: - context: ../ - dockerfile: ./docker/Dockerfile - command: ["source ~/.bashrc && python scripts/network_tester.py server TCP-SEND 0.0.0.0 1236"] - networks: - - ait - - udp-server: - container_name: udp-server - platform: linux/amd64 - build: - context: ../ - dockerfile: ./docker/Dockerfile - command: ["source ~/.bashrc && python -u scripts/network_tester.py server UDP 0.0.0.0 1238"] - networks: - - ait - -networks: - ait: - name: ait diff --git a/docker/network-test-config.yaml b/docker/network-test-config.yaml deleted file mode 100644 index 8f80629a..00000000 --- a/docker/network-test-config.yaml +++ /dev/null @@ -1,69 +0,0 @@ -default: - - cmddict: - filename: ../config/cmd.yaml - - tlmdict: - filename: ../config/tlm.yaml - - server: - - inbound-streams: - - - stream: - name: input_stream_debug_4 - input: - - input_stream_debug_1 - - input_stream_debug_2 - - input_stream_debug_3 - - input_stream_debug_5 - handlers: - - name: ait.core.server.handlers.DebugHandler - handler_name: "Input Stream Handler" - - - stream: - name: input_stream_debug_1 - input: - - "UDP:0.0.0.0:1234" - handlers: - - name: ait.core.server.handlers.DebugHandler - handler_name: "UDP Input Server Stream 1" - - - - stream: - name: input_stream_debug_2 - input: - - "TCP:0.0.0.0:1235" - handlers: - - name: ait.core.server.handlers.DebugHandler - handler_name: "TCP Input Server Stream 2" - - - stream: - name: input_stream_debug_3 - input: - - "TCP:tcp-server-send:1236" - handlers: - - name: ait.core.server.handlers.DebugHandler - handler_name: "TCP Input Client Stream 3" - - - stream: - name: input_stream_debug_5 - input: 6969 - handlers: - - name: ait.core.server.handlers.DebugHandler - handler_name: "TCP Input Client Stream 4" - - outbound-streams: - - stream: - name: output_stream_debug_1 - input: - - input_stream_debug_1 - output: - - "TCP:tcp-server:1237" - - - stream: - name: output_stream_debug_2 - input: - - input_stream_debug_2 - output: - - "UDP:udp-server:1238" diff --git a/scripts/network_tester.py b/scripts/network_tester.py deleted file mode 100644 index e726fc14..00000000 --- a/scripts/network_tester.py +++ /dev/null @@ -1,73 +0,0 @@ -import socket -import sys -import time - -RATE = 1 # Do a little throttling so we dont completely thrash the server -BUFF_SIZE = 1024 -TEST_DATA = b'U'*BUFF_SIZE -def main(mode,protocol,host,port): - if mode == "server": - if protocol == "TCP" or protocol == "TCP-SEND": - sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - sock.bind((host, port)) - sock.listen() - connection, address = sock.accept() - with connection: - if protocol == "TCP": - ts = time.time() - data_size = 0 - while True: - buf = connection.recv(BUFF_SIZE) - data_size += len(buf) - te = time.time() - print(f"Received {data_size} bytes from {address} - est data rate: {data_size / (te-ts)}") - else: - while True: - connection.sendall(TEST_DATA) - time.sleep(RATE) - if protocol == "UDP": - server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - server_socket.bind((host, port)) - ts = time.time() - data_size = 0 - while True: - buf, address = server_socket.recvfrom(BUFF_SIZE) - data_size += len(buf) - te = time.time() - print(f"Received {data_size} bytes from {address} - est data rate: {data_size / (te-ts)}") - if mode == "client": - if protocol == "UDP": - sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - while True: - try: - print(f"Sent {len(TEST_DATA)} bytes to {host}:{port}") - sock.sendto(TEST_DATA, (host, port)) - time.sleep(RATE) - except Exception as e: - print(e) - continue - if protocol == "TCP": - sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - connected = False - while not connected: - try: - sock.connect((host, port)) - connected = True - except Exception as e: - print("retrying connection") - time.sleep(1) - while True: - try: - sock.send(TEST_DATA) - time.sleep(RATE) - except Exception as e: - print(e) - continue - -if __name__ == "__main__": - print(sys.argv) - mode = sys.argv[1] - protocol = sys.argv[2] - host = sys.argv[3] - port = sys.argv[4] - sys.exit(main(mode,protocol,host,int(port)))