inputs: pre-defined input paths
Instead of bind-mounting each individual input into the container,
create a temporary directory that is used by all inputs and bind-
mount this to the well known location ("/run/osbuild/inputs"). The
temporary directory is then passed to the input so that it can
make the requested resources available relative to that directory.
This is enforced by the common input handling code.
Additionally, pass the well known input path via a new "paths" key
to the arguments dictionary passed to the stage.
This commit is contained in:
parent
47fefe7e2d
commit
08bc9ab7d8
6 changed files with 45 additions and 28 deletions
|
|
@ -8,9 +8,9 @@ it to the stage.
|
|||
|
||||
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
from osbuild.objectstore import StoreClient
|
||||
import uuid
|
||||
|
||||
|
||||
SCHEMA = """
|
||||
|
|
@ -21,10 +21,12 @@ SCHEMA = """
|
|||
def main():
|
||||
args = json.load(sys.stdin)
|
||||
refs = args["refs"]
|
||||
target = args["target"]
|
||||
|
||||
store = StoreClient(connect_to=args["api"]["store"])
|
||||
uid = str(uuid.uuid4())
|
||||
path = os.path.join(target, uid)
|
||||
os.makedirs(path)
|
||||
|
||||
path = store.mkdtemp(prefix="empty")
|
||||
data = {"path": path, "data": {"refs": refs}}
|
||||
json.dump(data, sys.stdout)
|
||||
return 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue