Skip to content

Commit

Permalink
add basic fake implementation of sdaccel-builder for testing (#266)
Browse files Browse the repository at this point in the history
* build fake-sdaccel-builder image for fake-batch testing
  • Loading branch information
Max Siegieda authored Nov 13, 2018
1 parent 899ac23 commit eb6f968
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docker-compose.on-prem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ services:
- RECO_FEATURE_DEP_QUEUE=1
- RECO_PUBLIC_PROJECT_ID=a95550bf-bffa-42df-b100-872501940c5c

fake-sdaccel-builder:
build: ./fake-sdaccel-builder
image: fake-sdaccel-builder:latest

networks:
platform:
driver: bridge
Expand Down
6 changes: 6 additions & 0 deletions fake-sdaccel-builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM alpine:3.8

RUN apk add bash curl

COPY aws/*.sh /opt/
WORKDIR /mnt
23 changes: 23 additions & 0 deletions fake-sdaccel-builder/aws/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -e

function post_event {
curl -XPOST -H "Content-Type: application/json" -d '{"status": "'"$1"'", "message": "'"$2"'", "code": '${3-0}'}' "$CALLBACK_URL" &> /dev/null
}

post_event STARTED

echo "downloading source code... done"

echo "compiling host cmds... done"

echo "compiling fpga kernel..."

for i in $(seq 1 100)
do echo $i%
sleep 1
done

echo "uploading artifacts... done"

post_event COMPLETED
21 changes: 21 additions & 0 deletions fake-sdaccel-builder/aws/graph.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -e

function post_event {
curl -XPOST -H "Content-Type: application/json" -d '{"status": "'"$1"'", "message": "'"$2"'", "code": '${3-0}'}' "$CALLBACK_URL" &> /dev/null
}

post_event STARTED

echo "downloading source code... done"

echo "generating graph..."

for i in $(seq 1 100)
do echo $i%
sleep 1
done

echo "uploading graph... done"

post_event COMPLETED
19 changes: 19 additions & 0 deletions fake-sdaccel-builder/aws/simulate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
set -e

function post_event {
curl -XPOST -H "Content-Type: application/json" -d '{"status": "'"$1"'", "message": "'"$2"'", "code": '${3-0}'}' "$CALLBACK_URL" &> /dev/null
}

post_event STARTED

echo "downloading source code... done"

echo "running simulation..."

for i in $(seq 1 100)
do echo $i%
sleep 1
done

post_event COMPLETED

0 comments on commit eb6f968

Please sign in to comment.