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

✨ custom user bind and ephemeral mounts #692

Merged
merged 18 commits into from
Feb 3, 2023
Merged

Conversation

oz123
Copy link
Contributor

@oz123 oz123 commented Jan 19, 2023

Users can now specify custom and ephemeral mounts in cloud-init under the install section, e.g.:

users:
 - name: kairos
...
install:
  auto: true
  device: "auto"
  bind_mounts:
  - /mnt/bind1
  - /mnt/bind2
  ephemeral_mounts:
  - /mnt/ephemeral
  - /mnt/ephemeral2
...

Ephemeral mounts are mounted as RW - but changes are discarded when the machine is restart.
Bind mounts will persist changes after restarted.

This is a fix for #210

Signed-off-by: Oz Tiram oz@spectrocloud.com

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

@netlify
Copy link

netlify bot commented Jan 19, 2023

Deploy Preview for kairos-io canceled.

Name Link
🔨 Latest commit 5acc848
🔍 Latest deploy log https://app.netlify.com/sites/kairos-io/deploys/63dccb674b0ee9000893cfcc

@oz123
Copy link
Contributor Author

oz123 commented Jan 19, 2023

This is now working. However, the tests are not complete yet, and docs are needed.

@oz123 oz123 force-pushed the feature/custom-mounts branch from 559619a to 972e21c Compare January 19, 2023 21:47
@oz123 oz123 changed the title :sparkels: custom user bind and ephemeral mounts :sparkel: custom user bind and ephemeral mounts Jan 19, 2023
@oz123 oz123 changed the title :sparkel: custom user bind and ephemeral mounts ✨ custom user bind and ephemeral mounts Jan 19, 2023
@oz123 oz123 force-pushed the feature/custom-mounts branch from 972e21c to 4ad6367 Compare January 19, 2023 21:49
@oz123 oz123 requested a review from mudler January 19, 2023 21:49
@oz123 oz123 force-pushed the feature/custom-mounts branch 2 times, most recently from 333a33f to 4abe644 Compare January 25, 2023 19:07
@oz123 oz123 marked this pull request as ready for review January 25, 2023 19:09
@oz123 oz123 requested review from jimmykarily and Itxaka January 25, 2023 19:09
@oz123 oz123 force-pushed the feature/custom-mounts branch from 4abe644 to f488b34 Compare January 25, 2023 19:48
@codecov-commenter
Copy link

codecov-commenter commented Jan 26, 2023

Codecov Report

Merging #692 (5acc848) into master (ace523e) will not change coverage.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@           Coverage Diff           @@
##           master     #692   +/-   ##
=======================================
  Coverage   19.57%   19.57%           
=======================================
  Files          18       18           
  Lines        1446     1446           
=======================================
  Hits          283      283           
  Misses       1114     1114           
  Partials       49       49           
Impacted Files Coverage Δ
pkg/config/config.go 56.44% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@oz123 oz123 enabled auto-merge (squash) January 26, 2023 11:44
@oz123 oz123 requested a review from mudler January 26, 2023 11:44
tests/custom_mount_test.go Outdated Show resolved Hide resolved
Earthfile Outdated Show resolved Hide resolved
Earthfile Outdated Show resolved Hide resolved
@oz123 oz123 force-pushed the feature/custom-mounts branch 5 times, most recently from 9979a69 to 1dcce77 Compare January 26, 2023 20:15
@oz123 oz123 requested a review from mudler January 26, 2023 20:16
@oz123 oz123 force-pushed the feature/custom-mounts branch 2 times, most recently from f4a14fd to 30eac03 Compare January 31, 2023 18:47
@oz123 oz123 requested a review from mudler January 31, 2023 18:47
@oz123 oz123 force-pushed the feature/custom-mounts branch from 30eac03 to 3252b3c Compare February 1, 2023 13:12
@oz123
Copy link
Contributor Author

oz123 commented Feb 1, 2023

https://github.com/kairos-io/kairos/actions/runs/4029252749/jobs/6927273668 https://github.com/kairos-io/kairos/actions/runs/4029252749/jobs/6927273719 the upgrade test seems to fail consistently

@mudler seems that was because I added earthlyignore file. I took this commit out, this is now handled in #794 .

oz123 added 16 commits February 2, 2023 15:53
Users can now specify custom and ephemeral mounts in cloud-init under
the `install` section, e.g.:

```
users:
 - name: kairos
...
install:
  auto: true
  device: "auto"
  bind_mounts:
  - /mnt/bind1
  - /mnt/bind2
  ephemeral_mounts:
  - /mnt/ephemeral
  - /mnt/ephemeral2
...
```
Ephemeral mounts are mounted as RW - but changes are discarded when the
machine is restart.
Bind mounts will persist changes after restarted.

This is a fix for #210

Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
DRY the code, change how we call the function install_test

Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
We repeat this a more than twice so just extract to own
target...

Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
This is not needed here.

Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Helps deal with space running out in the CI.

Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
@oz123 oz123 force-pushed the feature/custom-mounts branch from 3252b3c to 8037c7e Compare February 2, 2023 14:53
@mudler mudler enabled auto-merge (squash) February 2, 2023 21:28
@mudler mudler disabled auto-merge February 3, 2023 10:03
@mudler mudler merged commit f8aef9e into master Feb 3, 2023
@mudler mudler deleted the feature/custom-mounts branch February 3, 2023 10:04
@mudler mudler mentioned this pull request Feb 3, 2023
mudler added a commit that referenced this pull request Feb 3, 2023
* ✨ custom user bind and ephemeral mounts

Users can now specify custom and ephemeral mounts in cloud-init under
the `install` section, e.g.:

```
users:
 - name: kairos
...
install:
  auto: true
  device: "auto"
  bind_mounts:
  - /mnt/bind1
  - /mnt/bind2
  ephemeral_mounts:
  - /mnt/ephemeral
  - /mnt/ephemeral2
...
```
Ephemeral mounts are mounted as RW - but changes are discarded when the
machine is restart.
Bind mounts will persist changes after restarted.

This is a fix for #210

Signed-off-by: Oz Tiram <oz@spectrocloud.com>

* Add the custom user mount to /cos/run/cos-layout.env

Signed-off-by: Oz Tiram <oz@spectrocloud.com>

* Add docs for custom user mounts in configuration example

Signed-off-by: Oz Tiram <oz@spectrocloud.com>

* Reuse test_install function

DRY the code, change how we call the function install_test

Signed-off-by: Oz Tiram <oz@spectrocloud.com>

* Enable custom mount tests and install tests

Signed-off-by: Oz Tiram <oz@spectrocloud.com>

* Enable tests in CI

Signed-off-by: Oz Tiram <oz@spectrocloud.com>

* Remove duplicate if check

Signed-off-by: Oz Tiram <oz@spectrocloud.com>

* Remove uneeded fmt.Println ...

Signed-off-by: Oz Tiram <oz@spectrocloud.com>

* Use separate label for custom mounts

Signed-off-by: Oz Tiram <oz@spectrocloud.com>

* 🔧 Earthfile - DRY ginkgo

We repeat this a more than twice so just extract to own
target...

Signed-off-by: Oz Tiram <oz@spectrocloud.com>

* Correct return type for  ContainElements

Signed-off-by: Oz Tiram <oz@spectrocloud.com>

* Remove CLOUD_INIT from custom mounts test

This is not needed here.

Signed-off-by: Oz Tiram <oz@spectrocloud.com>

* Fix qemu-test-* earthly targets

Signed-off-by: Oz Tiram <oz@spectrocloud.com>

* 🔧 Fix CPU passing to VM

Signed-off-by: Oz Tiram <oz@spectrocloud.com>

* 🔧 remove apt cache after install qemu

Helps deal with space running out in the CI.

Signed-off-by: Oz Tiram <oz@spectrocloud.com>

* 📖 Document custom mounts

Signed-off-by: Oz Tiram <oz@spectrocloud.com>

---------

Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants