Skip to content

Commit 06217c1

Browse files
committed
tests: add initial build.yml
1 parent 0bec870 commit 06217c1

File tree

8 files changed

+344
-10
lines changed

8 files changed

+344
-10
lines changed

.DS_Store

-6 KB
Binary file not shown.

.github/workflows/build.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Compile hashpipe.so
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- uds-to-grpc
8+
- test-build-action
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
build-default:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up build environment
21+
run: |
22+
# Install build-time dependencies for hashpipe
23+
sudo apt-get update
24+
sudo apt-get install -y --no-install-recommends build-essential git autoconf automake libtool g++ make
25+
26+
# Build and Install Hashpipe (from original Dockerfile)
27+
git clone --depth 1 https://github.com/david-macmahon/hashpipe.git /tmp/hashpipe
28+
cd /tmp/hashpipe/src
29+
autoreconf -is
30+
./configure --prefix=/usr/local
31+
make
32+
sudo make install
33+
34+
- name: Compile hashpipe.so with default Makefile
35+
working-directory: panoseti_daq # Assuming panoseti_daq is at the root of your repo
36+
run: make
37+
38+
build-aarch64:
39+
runs-on: ubuntu-latest # You might need a self-hosted runner with aarch64 or a specialized GitHub Actions runner for actual aarch64 compilation. For a compilation check, ubuntu-latest might suffice if it can cross-compile.
40+
steps:
41+
- name: Checkout repository
42+
uses: actions/checkout@v4
43+
44+
- name: Set up build environment
45+
run: |
46+
# Install build-time dependencies for hashpipe
47+
sudo apt-get update
48+
sudo apt-get install -y --no-install-recommends build-essential git autoconf automake libtool g++ make
49+
50+
# Build and Install Hashpipe (from original Dockerfile)
51+
git clone --depth 1 https://github.com/david-macmahon/hashpipe.git /tmp/hashpipe
52+
cd /tmp/hashpipe/src
53+
autoreconf -is
54+
./configure --prefix=/usr/local
55+
make
56+
sudo make install
57+
58+
- name: Compile hashpipe.so with Makefile.aarch64
59+
working-directory: panoseti_daq # Assuming panoseti_daq is at the root of your repo
60+
run: make -f Makefile.aarch64

.gitignore

Lines changed: 268 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,269 @@
11
.vscode/*
2+
# Byte-compiled / optimized / DLL files
3+
1 __pycache__/
4+
2 *.py[codz]
5+
3 *$py.class
6+
4
7+
5 # C extensions
8+
6 *.so
9+
7
10+
8 # Distribution / packaging
11+
9 .Python
12+
10 build/
13+
11 develop-eggs/
14+
12 dist/
15+
13 downloads/
16+
14 eggs/
17+
.gitignore
18+
".gitignore" 221L, 4821B
19+
1 # Byte-compiled / optimized / DLL files
20+
1 __pycache__/
21+
2 *.py[codz]
22+
3 *$py.class
23+
4
24+
5 # C extensions
25+
6 *.so
26+
7
27+
8 # Distribution / packaging
28+
9 .Python
29+
10 build/
30+
11 develop-eggs/
31+
12 dist/
32+
13 downloads/
33+
14 eggs/
34+
.gitignore
35+
".gitignore" 221L, 4821B
36+
27 # Byte-compiled / optimized / DLL files
37+
32 coverage.xml
38+
1 # Byte-compiled / optimized / DLL files
39+
1 __pycache__/
40+
2 *.py[codz]
41+
3 *$py.class
42+
4
43+
5 # C extensions
44+
6 *.so
45+
7
46+
8 # Distribution / packaging
47+
9 .Python
48+
10 build/
49+
11 develop-eggs/
50+
12 dist/
51+
13 downloads/
52+
14 eggs/
53+
15 .eggs/
54+
16 lib/
55+
17 lib64/# Byte-compiled / optimized / DLL files
56+
__pycache__/
57+
*.py[codz]
58+
*$py.class
59+
60+
# C extensions
61+
*.so
62+
63+
# Distribution / packaging
64+
.Python
65+
build/
66+
develop-eggs/
67+
dist/
68+
downloads/
69+
eggs/
70+
.eggs/
71+
lib/
72+
lib64/
73+
parts/
74+
sdist/
75+
var/
76+
wheels/
77+
share/python-wheels/
78+
*.egg-info/
79+
.installed.cfg
80+
*.egg
81+
MANIFEST
82+
83+
# PyInstaller
84+
# Usually these files are written by a python script from a template
85+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
86+
*.manifest
87+
*.spec
88+
89+
# Installer logs
90+
pip-log.txt
91+
pip-delete-this-directory.txt
92+
93+
# Unit test / coverage reports
94+
htmlcov/
95+
.tox/
96+
.nox/
97+
.coverage
98+
.coverage.*
99+
.cache
100+
nosetests.xml
101+
coverage.xml
102+
*.cover
103+
*.py.cover
104+
.hypothesis/
105+
.pytest_cache/
106+
cover/
107+
108+
# Translations
109+
*.mo
110+
*.pot
111+
112+
# Django stuff:
113+
*.log
114+
local_settings.py
115+
db.sqlite3
116+
db.sqlite3-journal
117+
118+
# Flask stuff:
119+
instance/
120+
.webassets-cache
121+
122+
# Scrapy stuff:
123+
.scrapy
124+
125+
# Sphinx documentation
126+
docs/_build/
127+
128+
# PyBuilder
129+
.pybuilder/
130+
target/
131+
132+
# Jupyter Notebook
133+
.ipynb_checkpoints
134+
135+
# IPython
136+
profile_default/
137+
ipython_config.py
138+
139+
# pyenv
140+
# For a library or package, you might want to ignore these files since the code is
141+
# intended to run in multiple environments; otherwise, check them in:
142+
# .python-version
143+
144+
# pipenv
145+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
146+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
147+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
148+
# install all needed dependencies.
149+
#Pipfile.lock
150+
151+
# UV
152+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
153+
# This is especially recommended for binary packages to ensure reproducibility, and is more
154+
# commonly ignored for libraries.
155+
#uv.lock
156+
157+
# poetry
158+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
159+
# This is especially recommended for binary packages to ensure reproducibility, and is more
160+
# commonly ignored for libraries.
161+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
162+
#poetry.lock
163+
#poetry.toml
164+
165+
# pdm
166+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
167+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
168+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
169+
#pdm.lock
170+
#pdm.toml
171+
.pdm-python
172+
.pdm-build/
173+
174+
# pixi
175+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
176+
#pixi.lock
177+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
178+
# in the .venv directory. It is recommended not to include this directory in version control.
179+
.pixi
180+
181+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
182+
__pypackages__/
183+
184+
# Celery stuff
185+
celerybeat-schedule
186+
celerybeat.pid
187+
188+
# SageMath parsed files
189+
*.sage.py
190+
191+
# Environments
192+
.env
193+
.envrc
194+
.venv
195+
env/
196+
venv/
197+
ENV/
198+
env.bak/
199+
venv.bak/
200+
.idea
201+
202+
# Spyder project settings
203+
.spyderproject
204+
.spyproject
205+
206+
# Rope project settings
207+
.ropeproject
208+
209+
# mkdocs documentation
210+
/site
211+
212+
# mypy
213+
.mypy_cache/
214+
.dmypy.json
215+
dmypy.json
216+
217+
# Pyre type checker
218+
.pyre/
219+
220+
# pytype static type analyzer
221+
.pytype/
222+
223+
# Cython debug symbols
224+
cython_debug/
225+
226+
# PyCharm
227+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
228+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
229+
# and can be added to the global gitignore or merged into this file. For a more nuclear
230+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
231+
#.idea/
232+
233+
# Abstra
234+
# Abstra is an AI-powered process automation framework.
235+
# Ignore directories containing user credentials, local state, and settings.
236+
# Learn more at https://abstra.io/docs
237+
.abstra/
238+
239+
# Visual Studio Code
240+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
241+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
242+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
243+
# you could uncomment the following to ignore the entire vscode folder
244+
# .vscode/
245+
246+
# Ruff stuff:
247+
.ruff_cache/
248+
249+
# PyPI configuration file
250+
.pypirc
251+
252+
# Cursor
253+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
254+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
255+
# refer to https://docs.cursor.com/context/ignore-files
256+
.cursorignore
257+
.cursorindexingignore
258+
259+
# Marimo
260+
marimo/_static/
261+
marimo/_lsp/
262+
__marimo__/
263+
264+
# Mac DS_Store
265+
*.DS_Store
266+
267+
# cProfile
268+
*.prof
269+

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ SOURCES = net_thread.c \
1717
./util/pff.cpp \
1818
./util/image.cpp
1919

20-
INCLUDES = databuf.h compute_thread.h process_frame.h snapshot.h
20+
INCLUDES = databuf.h compute_thread.h process_frame.h snapshot.h net_thread.h
2121

2222
N_INPUT_BLOCKS=512
2323
N_OUTPUT_BLOCKS=128

Makefile.aarch64

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ SOURCES = net_thread.c \
1313
output_thread.c \
1414
process_frame.c \
1515
databuf.c \
16+
snapshot.c \
1617
./util/pff.cpp \
1718
./util/image.cpp
1819

1920
N_INPUT_BLOCKS=128
2021
N_OUTPUT_BLOCKS=32
2122

22-
INCLUDES = databuf.h compute_thread.h process_frame.h
23+
INCLUDES = databuf.h compute_thread.h process_frame.h snapshot.h net_thread.h
2324

2425
all: $(TARGET)
2526

net_thread.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,13 @@
1717
#include <errno.h>
1818

1919
#include "hashpipe.h"
20-
2120
#include "databuf.h"
2221
#include "snapshot.h"
2322
#include "pff.h"
2423
#include "dp.h"
2524
#include "image.h"
25+
#include "net_thread.h"
2626

27-
// PKTSOCK Params
28-
// (These should be only changed with caution as it need to change with MMAP)
29-
#define PKTSOCK_BYTES_PER_FRAME (1024)
30-
#define PKTSOCK_FRAMES_PER_BLOCK (4096)
31-
#define PKTSOCK_NBLOCKS (512)
32-
#define PKTSOCK_NFRAMES (PKTSOCK_FRAMES_PER_BLOCK * PKTSOCK_NBLOCKS)
3327

3428
// get the time difference
3529
static uint64_t timeval_diff(struct timeval *start, struct timeval *end)

net_thread.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#ifndef _NET_THREAD_H_
2+
#define _NET_THREAD_H_
3+
4+
// PKTSOCK Params
5+
// (These should be only changed with caution as it need to change with MMAP)
6+
#define PKTSOCK_BYTES_PER_FRAME (1024)
7+
#define PKTSOCK_FRAMES_PER_BLOCK (4096)
8+
#define PKTSOCK_NBLOCKS (512)
9+
#define PKTSOCK_NFRAMES (PKTSOCK_FRAMES_PER_BLOCK * PKTSOCK_NBLOCKS)
10+
11+
12+
#endif /* _NET_THREAD_H_ */

snapshot.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#ifndef _SNAPSHOT_H_
22
#define _SNAPSHOT_H_
33

4-
#include <sys/time.h>
54
#include <stdio.h>
65
#include <stdint.h>
76
#include "databuf.h"

0 commit comments

Comments
 (0)