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

Add "entry_point" to bead meta #46

Open
korenmiklos opened this issue Nov 17, 2021 · 2 comments
Open

Add "entry_point" to bead meta #46

korenmiklos opened this issue Nov 17, 2021 · 2 comments

Comments

@korenmiklos
Copy link
Contributor

so that other tools can automatically run the computation in the bead after bead develop and bead input load. Like

"entry_point": "stata -b do main.do"
@korenmiklos
Copy link
Contributor Author

bead command stata -b do main.do
bead save
bead develop NAME
bead input update
bead update

or

bead run

@e3krisztian
Copy link
Owner

I think entry_point is not a good name, what about build_command instead?

I was also thinking about the command line interface and implementation for using it (rebuilding beads):

bead build [--show] [BUILD COMMAND WITH ARGUMENTS]

Records or executes build commands

  • bead build make output records make output as the command used for building the output
  • bead build runs the previously recorded build command
  • bead build --show shows the previously recorded build command

bead build --recursive [--dir BUILD-DIR]

Rebuilds the workspace, the inputs are updated, and loaded.

Something like

# rebuild inputs
for INPUT in workspace.inputs:
    bead build --recursive --dir BUILD-DIR INPUT.bead_name
    bead input update INPUT.name
# rebuild workspace
bead build

bead build [--recursive] [--dir BUILD-DIR] --package PACKAGE

Rebuilds PACKAGE and if required, all of its dependencies recursively.

a recursive build would work like this:

cd BUILD-DIR
if file PACKAGE exists:
    # this package was already built
    return
bead develop PACKAGE
cd PACKAGE
if recursive:
    bead build --recursive --dir BUILD-DIR
else:
    bead input update
    bead build
bead save
cd ..
bead zap PACKAGE
# leave a sentinel behind to prevent repeated builds
touch PACKAGE

Notes:

  • existing BUILD-DIR/PACKAGE will prevent building PACKAGE
  • BUILD-DIR defaults to abspath('temp/build')
  • all bead build-s and bead save-s should be conditional for package builds (i.e. not a workspace initiated build): only if one of its dependencies have been updated

Open problem[s]:

  • What to do with existing beads? Smart default (make) or fail?
  • What should happen when there is a failure rebuilding one of the dependencies (e.g. no build command recorded, or command exiting with error)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants