This repository has been archived by the owner on Jan 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
28 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
--- | ||
- name: Ensure system is rebooted | ||
reboot: | ||
|
||
- name: Ensure Ansible facts are up to date | ||
setup: |
7 changes: 2 additions & 5 deletions
7
accelpy/_ansible/roles/container_service/molecule/default/app.Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 6 additions & 18 deletions
24
accelpy/_ansible/roles/container_service/molecule/default/app_server.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,20 @@ | ||
#! /usr/bin/env python3 | ||
# coding=utf-8 | ||
"""Fake application web server""" | ||
from os import getuid, getgid, environ | ||
from json import dumps | ||
from http.server import HTTPServer, BaseHTTPRequestHandler | ||
from accelize_drm.fpga_drivers import get_driver | ||
from traceback import format_exc | ||
from subprocess import run, PIPE, STDOUT | ||
|
||
|
||
class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): | ||
"""Server that return FPGA response""" | ||
"""Server that test FPGA presence""" | ||
|
||
def do_GET(self): | ||
"""GET""" | ||
try: | ||
driver = get_driver(name='aws_f1')( | ||
fpga_slot_id=int(environ['FPGA_SLOTS'].split(',', 1)[0])) | ||
code = 200 | ||
msg = dumps(dict( | ||
response=driver.read_register(0), | ||
uid=getuid(), gid=getgid(), | ||
)) | ||
except Exception: | ||
code = 500 | ||
msg = format_exc() | ||
self.send_response(code) | ||
process = run(['/opt/xilinx/xrt/bin/awssak', 'list'], | ||
stderr=STDOUT, stdout=PIPE) | ||
self.send_response(500 if process.returncode else 200) | ||
self.end_headers() | ||
self.wfile.write(msg.encode() + b'\n') | ||
self.wfile.write(process.stdout) | ||
|
||
|
||
HTTPServer(('0.0.0.0', 8080), SimpleHTTPRequestHandler).serve_forever() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters