Skip to content

Commit

Permalink
Merge branch '6.0.x' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
macite committed Dec 23, 2021
2 parents a985ecf + 69d6283 commit df12356
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 30 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: create-doubtfire-deployment
name: create-doubtfire-overseer
on:
push:
tags:
Expand Down Expand Up @@ -39,6 +39,7 @@ jobs:
id: docker_build
uses: docker/build-push-action@v2
with:
file: Dockerfile
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
Expand Down
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,36 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [5.0.6](https://github.com/macite/doubtfire-deploy/compare/v5.0.5...v5.0.6) (2021-12-06)

### [5.0.5](https://github.com/macite/doubtfire-deploy/compare/v5.0.4...v5.0.5) (2021-11-19)


### Bug Fixes

* update bunny pub sub to fix launch and logging issues ([b9d967a](https://github.com/macite/doubtfire-deploy/commit/b9d967adbdf6ae1a36dd218c77c64d03c1fea09a))

### [5.0.4](https://github.com/macite/doubtfire-deploy/compare/v5.0.3...v5.0.4) (2021-11-19)


### Bug Fixes

* update bunny pub sub to fix subscriber launch ([57aeca6](https://github.com/macite/doubtfire-deploy/commit/57aeca6a92f94a539d0449de139dd8a841e9ab38))

### [5.0.3](https://github.com/macite/doubtfire-deploy/compare/v5.0.2...v5.0.3) (2021-11-19)


### Bug Fixes

* remove some limits to ensure test containers run ([9daab39](https://github.com/macite/doubtfire-deploy/commit/9daab3964fd75e218cd7e5f4ca2a44ccf994b1f6))

### [5.0.2](https://github.com/macite/doubtfire-deploy/compare/v5.0.1...v5.0.2) (2021-11-18)


### Features

* add proxy login to overseer ([9435c79](https://github.com/macite/doubtfire-deploy/commit/9435c79b1690153cecbb046542d7ef4d0990f452))

### [5.0.1](https://github.com/macite/doubtfire-deploy/compare/v5.0.0-2...v5.0.1) (2021-10-27)

## [5.0.0](https://github.com/macite/doubtfire-deploy/compare/v5.0.0-2...v5.0.0) (2021-10-13)
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WORKDIR /app

RUN gem install bundler

COPY Gemfile Gemfile.lock ./
COPY . .
RUN bundle install

# Is not needed as long as the equivalent HOST DIR
Expand All @@ -22,6 +22,4 @@ RUN bundle install
# && chown -R 1001:999 /home/overseer/work-dir \
# && chmod -R 777 /home/overseer/work-dir

COPY . /app/

CMD bundle exec ruby ./app.rb
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source 'http://rubygems.org'
ruby '~> 2.6.6'

gem 'bunny', '>= 2.14.1'
gem 'bunny-pub-sub', '0.0.9', git: 'https://github.com/doubtfire-overseer/bunny-pub-sub'
gem 'bunny-pub-sub', '0.5.2'
gem 'dotenv'
gem 'rubyzip'

Expand Down
13 changes: 4 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
GIT
remote: https://github.com/doubtfire-overseer/bunny-pub-sub
revision: 5e4f1acc99f0b1fd9a5fe3cbce6c8c55d94f7f1b
specs:
bunny-pub-sub (0.0.9)
bunny (~> 2.14)

GEM
remote: http://rubygems.org/
specs:
amq-protocol (2.3.2)
bunny (2.18.0)
amq-protocol (~> 2.3, >= 2.3.1)
sorted_set (~> 1, >= 1.0.2)
bunny-pub-sub (0.5.2)
bunny (~> 2.14)
dotenv (2.7.6)
ffi (1.15.3)
listen (3.5.1)
Expand All @@ -35,7 +30,7 @@ PLATFORMS

DEPENDENCIES
bunny (>= 2.14.1)
bunny-pub-sub (= 0.0.9)!
bunny-pub-sub (= 0.5.2)
dotenv
rerun
rubyzip
Expand All @@ -45,4 +40,4 @@ RUBY VERSION
ruby 2.6.6p146

BUNDLED WITH
2.2.16
2.2.33
10 changes: 10 additions & 0 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
require 'bunny-pub-sub/publisher'
require_relative 'overseer_receive_action.rb'

docker_config = {
DOCKER_PROXY_URL: ENV['DOCKER_PROXY_URL'],
DOCKER_TOKEN: ENV['DOCKER_TOKEN'],
DOCKER_USER: ENV['DOCKER_USER']
}
subscriber_config = {
RABBITMQ_HOSTNAME: ENV['RABBITMQ_HOSTNAME'],
RABBITMQ_USERNAME: ENV['RABBITMQ_USERNAME'],
Expand All @@ -26,6 +31,11 @@
ROUTING_KEY: 'overseer.result'
}

if docker_config[:DOCKER_TOKEN] && docker_config[:DOCKER_PROXY_URL]
puts "Logging into docker proxy"
`echo \"${DOCKER_TOKEN}\" | docker login --username ${DOCKER_USER} --password-stdin ${DOCKER_PROXY_URL}`
end

assessment_results_publisher = Publisher.new assessment_results_publisher_config

# Register subscriber for task submissions, runs overseer receive, and publishes results to assessment_results_publisher
Expand Down
22 changes: 9 additions & 13 deletions .env.example → overseer.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,20 @@
# RABBITMQ_HOSTNAME=192.254.254.254

# VM config.
RABBITMQ_HOSTNAME=10.0.2.2

RABBITMQ_USERNAME=guest
RABBITMQ_PASSWORD=guest
EXCHANGE_NAME=x_assessment
DURABLE_QUEUE_NAME=q_csharp
BINDING_KEYS=csharp
DEFAULT_BINDING_KEY=default_env
RABBITMQ_HOSTNAME=df-prod-mq
RABBITMQ_USERNAME=secure_credentials
RABBITMQ_PASSWORD=secure_credentials

# Default name for container to be used by
# this overseer instance for all image_tag values.
CONTAINER_NAME=overseer_container1

# Docker socket path.
DOCKER_SOCKET_PATH=/var/run/docker.sock
DOCKER_HOST=host.docker.internal

# Host path for writing the output of execution.
HOST_XFS_VOLUME=/var/tmp/overseer-instances/1
HOST_XFS_VOLUME=${PWD}/../data/overseer-instances/1

# Path for reading OnTrack files from.
ONTRACK_VOLUME=../overseer-pub-sub
DOCKER_ONTRACK_VOLUME=/overseer-pub-sub
DOCKER_TOKEN=password
DOCKER_USER=username
DOCKER_PROXY_URL=registry-1.docker.io
4 changes: 1 addition & 3 deletions overseer_receive_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,7 @@ def run_assessment_script_via_docker(output_path, random_string, exec_mode, comm
# #{image_name_tag} \
# /bin/bash -c \"#{command}\""

`timeout 60 docker run \
-m 100MB \
--memory-swap 100MB \
`timeout 300 docker run \
--restart no \
--cpus 1 \
--network none \
Expand Down
17 changes: 17 additions & 0 deletions test_assessment/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: "3"
services:
test_container:
container_name: overseer-test
image: macite/overseer-dotnet
networks:
- none
volumes:
# App's code path - not required in final image
- ./sandbox:/home/overseer/work-dir/sandbox
- ./output:/home/overseer/work-dir/output
command: /bin/bash -c "./build.sh ../output/test.yaml >> ../output/test.txt 2>> ../output/test.txt && ./run.sh ../output/test.yaml >> ../test.txt 2>> ../output/test.txt"

networks:
none:
driver: bridge
internal: true
Empty file added test_assessment/output/.keep
Empty file.
7 changes: 7 additions & 0 deletions test_assessment/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This folder contains infrastructure to help educators in setting up testing containers.

1. adjust the image in the docker compose file
2. put all of the files for the test in the sandbox folder
3. clear the output folder
4. run docker compose up
5. review the output folder for values in the yaml and txt files

0 comments on commit df12356

Please sign in to comment.