Skip to content
This repository has been archived by the owner on Jan 13, 2020. It is now read-only.
/ accelpy Public archive

Commit

Permalink
1.0.0-beta.8
Browse files Browse the repository at this point in the history
  • Loading branch information
JGoutin committed Jul 26, 2019
1 parent 2316009 commit cc91087
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 39 deletions.
2 changes: 1 addition & 1 deletion accelpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
__version__ = '1.0.0-beta.7'
__version__ = '1.0.0-beta.8'
__copyright__ = "Copyright 2018 Accelize"
__licence__ = "Apache 2.0"

Expand Down
3 changes: 2 additions & 1 deletion accelpy/_ansible/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ def galaxy_install(self, roles):
roles (iterable of str): Roles to install.
"""
if roles:
self._ansible('install', *roles, utility='galaxy')
self._ansible('install', '--force-with-deps',
*roles, utility='galaxy')

@classmethod
def playbook_exec(cls):
Expand Down
3 changes: 3 additions & 0 deletions accelpy/_ansible/roles/common.reboot_system/tasks/main.yml
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:
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
FROM accelize/base:centos_7-aws_f1

RUN yum install -y \
yum-utils \
epel-release && \
yum-config-manager --add-repo https://accelize.s3.amazonaws.com/rpm/accelize_stable.repo && \
yum install -y python36-accelize-drm && \
RUN yum install -y epel-release && \
yum install -y python36 && \
rm -rf /var/cache/yum/*

EXPOSE 8080
Expand Down
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()
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ platforms:
environment:
container: docker

#- name: podman
# image: ubuntu:bionic
# privileged: true
# volume_mounts:
# - "/sys/fs/cgroup:/sys/fs/cgroup:rw"
# command: "/lib/systemd/systemd"
# environment:
# container: docker
# - name: podman
# image: ubuntu:bionic
# privileged: true
# volume_mounts:
# - "/sys/fs/cgroup:/sys/fs/cgroup:rw"
# command: "/lib/systemd/systemd"
# environment:
# container: docker

provisioner:
name: ansible
Expand Down
6 changes: 3 additions & 3 deletions tests/test_app_container_service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ firewall_rules:

fpga:
aws,eu-west-1:
image: agfi-04d518960fd114e28
image: agfi-071909cc191313a51
count: 1

package:
Expand All @@ -23,11 +23,11 @@ package:
accelize_drm:
conf:
design:
boardType: DRM_125
boardType: DRM_100
licensing:
url: https://master.metering.accelize.com
drm:
frequency_mhz: 125
frequency_mhz: 100

test:
shell: curl -sS $(accelpy public_ip):8080
6 changes: 3 additions & 3 deletions tests/test_app_kubernetes_node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ firewall_rules:

fpga:
aws,eu-west-1:
image: agfi-04d518960fd114e28
image: agfi-071909cc191313a51
count: 1

package:
Expand All @@ -23,8 +23,8 @@ package:
accelize_drm:
conf:
design:
boardType: DRM_125
boardType: DRM_100
licensing:
url: https://master.metering.accelize.com
drm:
frequency_mhz: 125
frequency_mhz: 100

0 comments on commit cc91087

Please sign in to comment.