Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI versions & cleanup setup scripts #1515

Merged
merged 4 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/local_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@

name: Local

on:
workflow_dispatch:

jobs:
local_build_container:
runs-on: panda-arc
steps:
- uses: actions/checkout@v2 # Clones to $GITHUB_WORKSPACE. NOTE: this requires git > 2.18 (not on ubuntu 18.04 by default) to get .git directory
- uses: actions/checkout@v4 # Clones to $GITHUB_WORKSPACE. NOTE: this requires git > 2.18 (not on ubuntu 18.04 by default) to get .git directory

- name: Build docker container from project root
run: echo $GITHUB_WORKSPACE; cd $GITHUB_WORKSPACE && DOCKER_BUILDKIT=1 docker build --progress=plain --target developer -t panda_local:${{ github.sha }} .
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/parallel_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Parallel Tests
# then run CI tests using that container in parallel
# For forked repos that can't use our panda-arc test suite, just build and run make check
on:
# Allow to repo owner to manually run this workflow for external PRs once code is vetted
workflow_dispatch:

# Run automatically for internal PRs and pushes
pull_request:
branches:
- dev
Expand All @@ -25,7 +29,7 @@ jobs:
- name: Install ssl
run: apt-get -qq install -y libssl-dev
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install Python dev headers
Expand Down Expand Up @@ -155,7 +159,7 @@ jobs:
runs-on: panda-arc

steps:
- uses: actions/checkout@v1 # Clones code into to /home/runner/work/panda
- uses: actions/checkout@v4 # Clones code into to /home/runner/work/panda

- name: Build docker container from project root
run: cd $GITHUB_WORKSPACE && docker build -t panda_local .
Expand Down
35 changes: 0 additions & 35 deletions .github/workflows/publish_deb.yml

This file was deleted.

26 changes: 14 additions & 12 deletions .github/workflows/publish_docker.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build and Publish Docker Container and Pypanda Docs # Only for main panda-re repo, not forks

on:
workflow_run:
push:
branches:
- dev
Expand All @@ -14,7 +15,6 @@ jobs:
if: github.repository == 'panda-re/panda' && github.ref == 'refs/heads/dev'
runs-on: panda-arc
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
v-version: ${{ steps.version.outputs.v-version }}
steps:
- name: Install git
Expand Down Expand Up @@ -60,9 +60,9 @@ jobs:
panda/debian/pandare_*.deb

- name: Store the PyPanda distribution packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
name: pypanda
path: panda/debian/pandare-*.whl
if-no-files-found: error

Expand All @@ -72,6 +72,7 @@ jobs:
with:
username: pandare
password: ${{secrets.pandare_dockerhub}}


#- name: 'Login to GHCR Registry'
# if: ${{ matrix.ubuntu_version == env.PANDA_CONTAINER_UBUNTU_VERSION }}
Expand Down Expand Up @@ -151,9 +152,9 @@ jobs:

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-package-distributions
name: pypanda
path: dist/

- name: Publish distribution 📦 to PyPI
Expand All @@ -176,13 +177,14 @@ jobs:

- name: Build Bionic container
# Push both dev and regular container
run: DOCKER_BUILDKIT=1 docker build --progress=plain --target=panda -t pandare/panda_stable:${GITHUB_SHA} $GITHUB_WORKSPACE;
docker tag pandare/panda_stable:${GITHUB_SHA} pandare/panda_stable:latest
docker push pandare/panda_stable:${GITHUB_SHA};
docker push pandare/panda_stable;
#DOCKER_BUILDKIT=1 docker build --progress=plain --target=developer -t pandare/pandadev:${GITHUB_SHA} $GITHUB_WORKSPACE;
#docker tag pandare/panadev:${GITHUB_SHA} pandare/pandadev:latest
#docker push pandare/pandadev;
uses: docker/build-push-action@v5
with:
push: true
context: ${{ github.workspace }}
tags: |
pandare/panda_stable:${{ github.sha }}
pandare/panda_stable:latest
target: panda

- name: Checkout docs and reset
run: rm -rf "${GITHUB_WORKSPACE}/auto_pydoc";
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
pull-requests: write

steps:
- uses: actions/stale@v3
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-close: 30
Expand Down
133 changes: 0 additions & 133 deletions .travis.yml

This file was deleted.

8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ $ docker run --rm pandadev panda-system-i386 --help
```

### Quickstart: Python pip
The Python interface to PANDA (also known as *pypanda*) can be installed from [PIP](https://pypi.org/project/pandare/) by running `pip3 install pandare`. This will install everything you need for python-based PANDA analyses, but not stand-alone PANDA binaries. This package is not automatically updated so it may fall behind the master branch of PANDA. The distributed binaries are only tested on 64-bit Ubuntu 18.04 and other architectures/versions are unlikely to work. You can also install pypanda by building PANDA and then running `python3 setup.py install` from the directory `panda/panda/python/core`.
The Python interface to PANDA (also known as *pypanda*) can be installed from [PIP](https://pypi.org/project/pandare/) by running `pip3 install pandare`. This will install everything you need for python-based PANDA analyses, but not stand-alone PANDA binaries. The distributed binaries are only tested on 64-bit Ubuntu 18.04 and other architectures/versions are unlikely to work. You can also install pypanda by building PANDA and then running `python3 setup.py install` from the directory `panda/panda/python/core`.

### Debian, Ubuntu
The fastest way to install PANDA would be through installing [the debian packages](https://github.com/pandare/panda/releases).
There is a debian package for both Ubuntu 20.04 and Ubuntu 22.04, and its corresponding PyPanda package.
Because PANDA has a few dependencies, we've encoded the build instructions into
the [install\_ubuntu.sh](panda/scripts/install\_ubuntu.sh). The script should
work on the latest Debian stable/Ubuntu LTS versions.
Expand All @@ -73,8 +75,8 @@ commands into whatever package manager your distribution uses.
Note that if you want to use our LLVM features (mainly the dynamic taint
system), you will need to install LLVM 11 from OS packages or compiled from
source. On Ubuntu this should happen automatically via `install_ubuntu.sh`.
Additionally, it is **strongly** recommended that you only build PANDA as 64bit
binary. Creating a 32bit build should be possible, but best avoided.
Additionally, it is **strongly** recommended that you only build PANDA as 64-bit binary.
Creating a 32-bit build should be possible, but best avoided.
See the limitations section for details.

### Arch Linux
Expand Down
15 changes: 8 additions & 7 deletions panda/debian/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,19 @@ if [[ ! -f "../dependencies/ubuntu_${version}_base.txt" ]]; then
exit 1
fi

# First build main panda container for the target ubuntu version
DOCKER_BUILDKIT=1 docker build --target panda -t panda --build-arg BASE_IMAGE="ubuntu:${version}" ../..
# Build the installer to generate the wheel file
DOCKER_BUILDKIT=1 docker build --target installer -t panda --build-arg BASE_IMAGE="ubuntu:${version}" ../..

# Copy wheel file out of container to host
# this also preserves wheel name, which is important as pip install WILL fail if you arbitarily change the generated wheel file name
docker run --rm -v $(pwd):/out panda bash -c "cp /panda/panda/python/core/dist/*.whl /out"

# Also build the installer, since that's where the whl file is built
DOCKER_BUILDKIT=1 docker build --target installer -t panda_installer --build-arg BASE_IMAGE="ubuntu:${version}" ../..
# Finish building main panda container for the target ubuntu version
DOCKER_BUILDKIT=1 docker build --target panda -t panda --build-arg BASE_IMAGE="ubuntu:${version}" ../..

# Now build the packager container from that
docker build -t packager .

# Copy deb file out of container to host
docker run --rm -v $(pwd):/out packager bash -c "cp /pandare.deb /out"
mv pandare.deb pandare_${version}.deb

# Copy whl file out of container to host, this also preserves wheel name, which is important as pip install WILL fail if you arbitarily change the generated wheel file name
docker run --rm -v $(pwd):/out panda_installer bash -c "cp /panda/panda/python/core/dist/*.whl /out"
7 changes: 2 additions & 5 deletions panda/docs/build_ubuntu.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Building on Ubuntu

Panda's build and runtime dependencies are listed in `panda/panda/dependencies/` for ubuntu 18, 19 and 20.
Panda's build and runtime dependencies are listed in `panda/panda/dependencies/` for ubuntu 18, 20 and 22.

If you install all the packages listed there, clone panda, and run build.sh you should be able to build panda:

Expand All @@ -19,10 +19,7 @@ mkdir -p build && cd build
If you would like to use **PyPANDA** you'll need to also install it and its dependencies:

```sh
# Pypanda dependencies
pip3 install pycparser "protobuf==3.0.0" "https://foss.heptapod.net/pypy/cffi/-/archive/branch/default/cffi-branch-default.zip" colorama

# Install pypanda
# Install pypanda, see requirements.txt for the installed python dependancies
cd panda/panda/python/core
python3 setup.py install
```
7 changes: 0 additions & 7 deletions panda/python/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,3 @@ from pandare import Panda
panda = Panda(generic='i386')
...
```


This is a beta release - Last updated Dec 2021.
---
* Although PANDA is fairly stable, this interface is new and subject to change significantly prior to version 1.0.

* This package is manually generated and may fall behind the code on GitHub.
3 changes: 0 additions & 3 deletions panda/python/core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

root_dir = os.path.join(*[os.path.dirname(__file__), "..", "..", ".."]) # panda-git/ root dir

pypi_build = False # Set to true if trying to minimize size for pypi package upload. Note this disables some architectures

lib_dir = os.path.join("pandare", "data")


Expand All @@ -27,7 +25,6 @@ def copy_objs():
Run to copy objects into a (local and temporary) python module before installing to the system.
Shouldn't be run if you're just installing in develop mode
'''
build_root = os.path.join(root_dir, "build")

if os.path.isdir(lib_dir):
shutil.rmtree(lib_dir)
Expand Down
Loading
Loading