Commit Graph

12 Commits

Author SHA1 Message Date
Dmitry Kovba c571546f60 Use a lock consistently in the ExecutionContext class (#619)
The changes in this PR improve the consistency of using a lock in the
`ExecutionContext` class.
2025-09-17 09:49:30 -07:00
Dmitry Kovba 0fd7005119 Fix a warning when testing (#531)
Fixes a warning missed in https://github.com/apple/container/pull/516.
2025-08-21 10:08:27 -07:00
Dmitry Kovba 9a597eb6aa Add the support for ARG in the native builder parser (#516)
This PR adds the support for the ARG instruction in the native builder
parser, implements the support for different kinds of ARGs, and performs
the substitution of ARG variables in the supported instructions.
Resolves https://github.com/apple/container/issues/437.

Some features are currently blocked and not included into this PR:
- [Native builder: add the current target platform we're building use it
to set automatic platform ARGs
#522](https://github.com/apple/container/issues/522)
- [Native builder: add the support for the BuildKit built-in ARGs
#523](https://github.com/apple/container/issues/523)
- [Native builder: ensure pre-defined ARGs are excluded from the output
of the history #524](https://github.com/apple/container/issues/524)
- [Native builder: add the support for stage references and ARG
inheritance #525](https://github.com/apple/container/issues/525)
2025-08-20 14:57:24 -07:00
Dmitry Kovba d2eb350393 Preserve permissions by default and fix warnings (#496)
Permissions should be preserved when copying by default. This PR also
fixes other warnings while building and testing.
2025-08-13 16:50:19 -07:00
J Logan b9a6bf52cc Fixes builder compiler errors and warnings. (#495) 2025-08-13 13:25:41 -07:00
Sidhartha Mani 3d0c1fee97 Native Builder: Build Cache to use new snapshotter (#492) 2025-08-13 10:46:14 -07:00
Sidhartha Mani d2f48982c1 Native Builder: Define Snapshotter protocol (#491)
This PR defines the snapshotter protocol

```swift
    ///Mount a snapshot and all its previous layers
    func prepare(_ snapshot: Snapshot) async throws -> Snapshot

    /// Commit a snapshot, making it permanent.
    func commit(_ snapshot: Snapshot) async throws -> Snapshot

    /// Remove a snapshot from snapshot store
    func remove(_ snapshot: Snapshot) async throws
```

It updates executors to work with this new protocol
2025-08-12 23:30:56 -07:00
Sidhartha Mani 0885cdd6a9 Native Builder: DiffKey and Differ Procol (#482)
This PR introduces the `Differ` with methods:

```swift
// Differ protocol
func diff(base: Snapshot?, target: Snapshot) async throws -> Descriptor
func apply(descriptor: Descriptor, to base: Snapshot?) async throws -> Snapshot
```

It also introduces `DiffKey`, which is a MerkeTree based key for fast
diff computations between two dirs
2025-08-12 11:23:55 -07:00
Kathryn Baldauf c21068661f Native builder parser support for EXPOSE (#465)
Closes https://github.com/apple/container/issues/430

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-08-07 12:17:59 -07:00
Kathryn Baldauf d048ea5201 Native builder: remove option token in favor of string literals (#450)
Remove the option token from the dockerfile tokenizer for the native
builder. This cleans up some of the logic around handling options
depending on if they're instruction options or user provided options to
a command.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-08-05 16:33:07 -07:00
Kathryn Baldauf 8adb215522 Native Builder: Add parser support for CMD and LABEL instructions (#448)
This PR adds support for CMD and LABEL instructions in the native
builder's parser.

This also changes how options are tokenized. Options now include the raw
string so that when constructing a command for instructions like CMD and
RUN, we can use the exact user input without having to add logic in the
tokenizer to know when we're parsing a command verses other options,
etc.

Closes https://github.com/apple/container/issues/428 and
https://github.com/apple/container/issues/429

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-08-05 14:34:34 -07:00
Kathryn Baldauf 16f2630126 Add initial native builder code (#399)
We're working on making a pure swift container image build system that
leverages containerization. This PR represents our initial design and
initial work towards this goal.

The native builder is still in active development and most of the
implementation has not been started or completed. We will be opening a
series of issues that represent various (but not necessarily all) pieces
of work that need to be done here.

There are docs included in this PR that describe the overall design of
each component and outline some of our goals. The easiest way to view
the docs by themselves (since this is a massive PR) is to look at the
docs commit in the `Commits` tab.

We'd love any feedback! 

@wlan0

---------

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-07-31 13:13:20 -07:00