diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..4257a2c --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,67 @@ +name: dockerized tests + +on: + push: + branches: + - master + - mseed + pull_request: + branches: + - master + - mseed + + +jobs: + Docker-build-and-push: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + + - name: Build and push base + id: docker_build_base + uses: docker/build-push-action@v2 + with: + context: ./ + file: ./base/amd64/Dockerfile + push: true + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/orcabase:latest + + - name: Build and push mseed + id: docker_build_mseed + uses: docker/build-push-action@v2 + with: + context: ./ + file: ./mseed/Dockerfile + push: true + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/orcamseed:latest + + Docker-container: + needs: Docker-build-and-push + runs-on: ubuntu-20.04 + steps: + - name: start containers + env: + AWSACCESSKEYID: ${{ secrets.AWSACCESSKEYID }} + AWSSECRETACCESSKEY: ${{ secrets.AWSSECRETACCESSKEY }} + TIME_PREFIX: ${{ secrets.TIME_PREFIX }} + DELAY_SEGMENT: ${{ secrets.DELAY_SEGMENT }} + NODE_NAME: ${{ secrets.NODE_NAME }} + NODE_LOOPBACK: ${{ secrets.NODE_LOOPBACK}} + ENV: ${{ secrets.ENV }} + run: docker run --name fetch_container karan2704/orcamseed:latest + + - name: run functions + run: docker exec -w /bin/bash fetch_container ooipypull.py + + - name: clean up containers + run: docker kill $(docker ps -q) + diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml deleted file mode 100644 index 8381edb..0000000 --- a/.github/workflows/docker-test.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: docker image testing - -on: - push: - branches: - - master - - mseed - pull_request: - branches: - - master - - mseed - -jobs: - Docker-tests: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - name: start containers - run: cd mseed/ && docker-compose up --build - - name: clean up containers - run: docker-compose down - diff --git a/base/amd64/Dockerfile b/base/amd64/Dockerfile index 217c3e3..d9d0620 100644 --- a/base/amd64/Dockerfile +++ b/base/amd64/Dockerfile @@ -12,3 +12,37 @@ MAINTAINER Orcasound RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg + +RUN apt-get update && apt-get install -y --no-install-recommends \ + # General tools + htop \ + nano \ + sox \ + tmux \ + wget \ + curl \ + git + +# Upgrade OS +RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold" + +# Set default command to bash as a placeholder +CMD ["/bin/bash"] + +# Make sure we're the root user +USER root + +WORKDIR /root + + +############################### Install boto and inotify libraies ################################### + +RUN apt-get update && apt-get install -y python3-pip +RUN pip3 install -U boto3 inotify + +############################## Copy common scripts ################################################## + +COPY . . + +# Clean up APT when done. +RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/mseed/Dockerfile b/mseed/Dockerfile index f8e7d0b..e9e661c 100644 --- a/mseed/Dockerfile +++ b/mseed/Dockerfile @@ -4,7 +4,7 @@ # Docker currently has a bug where armel is used instead when relying on # multiarch manifest: https://github.com/moby/moby/issues/34875 # When this is fixed, this can be changed to just `FROM debian:stretch-slim` -FROM orcastream/orcabase:latest +FROM karan2704/orcabase-amd64:latest MAINTAINER Orcasound RUN pip3 install numpy diff --git a/mseed/docker-compose.yml b/mseed/docker-compose.yml index 7ffcc1c..918a280 100644 --- a/mseed/docker-compose.yml +++ b/mseed/docker-compose.yml @@ -6,7 +6,7 @@ services: # command: tail -F README.md command: python ooipypull.py restart: always - env_file: .env + #env_file: .env volumes: - data:/tmp depends_on: @@ -17,7 +17,7 @@ services: build: ./ command: ./streamfiles.sh restart: always - env_file: .env + #env_file: .env volumes: - data:/tmp privileged: true