Skip to content

Commit

Permalink
[gzip] Support Intel OFS IA-420F/R0 and OFS IA-840F/R0 FPGA platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
eliaskoromilas committed Feb 8, 2024
1 parent 895005a commit 2ec7d67
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion charts/gzip/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ sources:
- https://docs.inaccel.com
- https://github.com/inaccel/marketplace
type: application
version: 1.1.3
version: 1.1.4
3 changes: 2 additions & 1 deletion charts/gzip/container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ FROM python:3.10-slim

RUN pip install --no-cache-dir \
inaccel-gzip-zlib \
gradio
gradio==3.20.* \
pydantic==1.*

WORKDIR /gradio
COPY app.py .
Expand Down
4 changes: 1 addition & 3 deletions charts/gzip/container/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import numpy as np
import os
import subprocess
import tempfile

from inaccel.gzip import compress

Expand All @@ -29,8 +28,7 @@ async def gzip(request: fastapi.Request) -> fastapi.Response:


def fn(file):
with open(os.path.join(tempfile.mkdtemp(), file.orig_name + '.gz'),
'wb') as _compressed_file:
with open(file.name + '.gz', 'wb') as _compressed_file:
with inaccel.allocator:
_file = np.fromfile(file.name)
_compressed_file.write(compress(_file.data))
Expand Down
2 changes: 2 additions & 0 deletions charts/gzip/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ questions:
- group: Platform
label: ' '
options:
- Intel OFS IA-420F/R0 (06dd1e32478657c38c353dc048cdb7e0)
- Intel OFS IA-840F/R0 (18f573d96298516d891fc9b6261e3a73)
- Intel PAC A10 (38d782e3b6125343b9342433e348ac4c)
- Intel PAC S10 (9346116da52d5ca8b06aa9a389ef7c8d)
- Intel PAC S10 USM (9346116da52d5ca8b06aa9a389ef7c8d)
Expand Down
6 changes: 3 additions & 3 deletions charts/gzip/templates/_platform.tpl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{{/* vim: set filetype=mustache: */}}

{{- define "platformName" -}}
{{- regexReplaceAll "^([^ ]+)[ /](.*)[ /]([^ ]+)$" $.Values.platform "${2}" | snakecase -}}
{{- regexReplaceAll "^([^ /]+)[ /](.*)[ /]([^ /]+)$" $.Values.platform "${2}" | lower | replace " " "_" | replace "-" "" | replace "/" "" -}}
{{- end -}}

{{- define "platformVendor" -}}
{{- regexReplaceAll "^([^ ]+)[ /](.*)[ /]([^ ]+)$" $.Values.platform "${1}" | lower -}}
{{- regexReplaceAll "^([^ /]+)[ /](.*)[ /]([^ /]+)$" $.Values.platform "${1}" | lower -}}
{{- end -}}

{{- define "platformVersion" -}}
{{- regexReplaceAll "^([^ ]+)[ /](.*)[ /]([^ ]+)$" $.Values.platform "${3}" | trimAll "()" -}}
{{- regexReplaceAll "^([^ /]+)[ /](.*)[ /]([^ /]+)$" $.Values.platform "${3}" | trimAll "()" -}}
{{- end -}}
2 changes: 2 additions & 0 deletions charts/gzip/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ autoscaling:
# scaleToZeroPodRetentionPeriod: ...
# target: ...
bitstreams:
intel/ofs_ia420fr0/06dd1e32478657c38c353dc048cdb7e0: intel/compression/1.0/2gzip
intel/ofs_ia840fr0/18f573d96298516d891fc9b6261e3a73: intel/compression/1.0/2gzip
intel/pac_a10/38d782e3b6125343b9342433e348ac4c: intel/compression/1.0/1gzip
intel/pac_s10/9346116da52d5ca8b06aa9a389ef7c8d: intel/compression/1.0/2gzip
intel/pac_s10_usm/9346116da52d5ca8b06aa9a389ef7c8d: intel/compression/1.0/2gzip
Expand Down

0 comments on commit 2ec7d67

Please sign in to comment.