ofrak icon indicating copy to clipboard operation
ofrak copied to clipboard

Add an ability to install OFRAK from source

Open ANogin opened this issue 2 years ago • 2 comments

One sentence summary of this PR (This should go in the CHANGELOG!) Add an ability to install OFRAK from source

Link to Related Issue(s) N/A

Please describe the changes in your request. This is a source tree equivalent of pip install for OFRAK - works similar to build_image.py approach, but does not require docker.

  • Run make install_core/make install_tutorial/make install_develop to pip-install OFRAK from the current source tree. The core and tutorial versions do regular install (make install for packages listed in the corresponding .yml), while the install_develop does an "editable mode" install (make develop for packages).
  • Pass OFRAK_INSTALL_DEPS=brew/OFRAK_INSTALL_DEPS=apt to make to have the dependencies (including the npm/rollout prerequisites) automatically installed.
  • Pass OFRAK_INSTALL_PYTHON=python3.x (with or without the full path) to make to have OFRAK installed for the particular instance of python on your system.

(This also adds handling of binja as a potentially-missing dependency, as make install_develop easily triggers a situation where the ofrak binja modules are there, but binja is not - let me know if you'd rather have that as a separate PR).

Anyone you think should look at this, specifically? @Edward-Larson probably? Maybe @rbs-jacob?

ANogin avatar May 23 '23 03:05 ANogin

@ANogin, if I understand the intent behind this PR, you are looking for a way to install OFRAK from source natively.

Did you consider building a Makefile target to do this? What I'm envisioning is something like:

OFRAK_CONFIG=ofrak-dev.yml PYTHON_PATH=python3 make develop

The Makefile target could then:

  1. Parse the yaml to get list of packages to install
  2. Call make develop/install in the respective directory
  3. There could be an optional argument at the end to run apt/brew commands

I also wonder if we need an automated script to install from source -- this is going to increase the amount of things taht need to be tested and maintained.

whyitfor avatar May 23 '23 15:05 whyitfor

Did you consider building a Makefile target to do this? What I'm envisioning is something like:

OFRAK_CONFIG=ofrak-dev.yml PYTHON_PATH=python3 make develop

@whyitfor , I can add OFRAK_CONFIG, but then would probably want to do the same for the build_image targets? Right now we have a few hardcoded targets with specific configs, rather than OFRAK_CONFIG, so I kept the same for consistency.

  1. Parse the yaml to get list of packages to install
  2. Call make develop/install in the respective directory

At least the above steps would presumably still require a python script?

  1. There could be an optional argument at the end to run apt/brew commands

Is there any benefit to handling the apt vs brew vs just print the suggestion logic in Makefile rather than in Python?

I also wonder if we need an automated script to install from source -- this is going to increase the amount of things taht need to be tested and maintained.

ANogin avatar May 23 '23 19:05 ANogin