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

merge in https://github.com/ashcrow/filetranspiler #76

Closed
cgwalters opened this issue Feb 7, 2020 · 15 comments · Fixed by #102
Closed

merge in https://github.com/ashcrow/filetranspiler #76

cgwalters opened this issue Feb 7, 2020 · 15 comments · Fixed by #102
Labels
enhancement New feature or request jira

Comments

@cgwalters
Copy link
Member

I propose we merge in the functionality from https://github.com/ashcrow/filetranspiler into this project. Strawman:

fcct --units myunits  --directory myconf --input foo.fcct > foo.ign

--directory would do what filetranspiler does today.
--units would look like:

myunits/
  foo.service
  bar.service
@ashcrow
Copy link
Member

ashcrow commented Feb 7, 2020

I am OK with this. One thing to keep in mind is that this will become something used in the field enough there should be stable builds produced and available.

cc @dustymabe @e-minguez @mrguitar @christianh814

@cgwalters
Copy link
Member Author

Yeah, one thing I am omitting here is the whole spec2 vs spec3 as well as another elephant 🐘 in the room which is MachineConfig vs Ignition. We'll need a debate about that. Plus the fact that parts of fcct high level may not apply to RHCOS (though ideally that's minimized).

I think tactically short term, we're not removing the filetranspiler project, just adding functionality to fcct.

@cgwalters
Copy link
Member Author

(I would probably say that we should have something like oc adm generate-machineconfig)

@jlebon
Copy link
Member

jlebon commented Feb 7, 2020

Could also be part of the YAML file itself as sugar, e.g.:

storage:
  local:
    - path: relpath/to/local/dir
      target: /path/to/extract  # or default to / if omitted?
systemd:
  local:
  - relpath/to/dir/of/units

That way the YAML stays self-contained and is easier to use from a config git repo containing all those source files.

@jlebon
Copy link
Member

jlebon commented Feb 7, 2020

Also worth cross-posting a similar-ish request for having fcct read files from the filesystem directly at coreos/fedora-coreos-tracker#375.

@ashcrow
Copy link
Member

ashcrow commented Feb 7, 2020

Could also be part of the YAML file itself as sugar, e.g.:

storage:
  local:
    - path: relpath/to/local/dir
      target: /path/to/extract  # or default to / if omitted?
systemd:
  local:
  - relpath/to/dir/of/units

That way the YAML stays self-contained and is easier to use from a config git repo containing all those source files.

I like this pattern. It doesn't seem like it would be helpful (yet) in RHCOS land but it's still a much nicer UX.

@cgwalters
Copy link
Member Author

Also related here is whether fcct exposes conversion functionality too: coreos/mantle#1190

@cgwalters
Copy link
Member Author

cgwalters commented Feb 24, 2020

Also from OpenShift architects one feedback on things here is a desire to avoid handing lots of binaries over to users. So we may end up e.g. adding Ignition functionality either to oc or openshift-installer. (Probably the former, but it needs an enhancement)

@bgilbert
Copy link
Contributor

bgilbert commented May 6, 2020

Proposal:

variant: fcos
version: 1.1.0-experimental
storage:
  trees:
    # Can have more than one of these
    - local: etc             # local base directory to walk, relative to files-dir
      path: /etc             # root of the destination tree; defaults to /
      follow_symlinks: true  # defaults to false, which copies symlinks as symlinks

Semantics:

  • This would walk the local tree and create file nodes embedding the contents of each file it finds (or link nodes, for links when follow_symlinks is false or missing). Mode bits would be copied, ownership would not.
  • Any existing file node with a matching path and existing contents would be an error.
  • Any existing file node without contents would be merged in. The node's mode, if set, would override the tree's file mode.
  • directory nodes would not be created; we'd rely on Ignition's existing behavior of creating parent directories automatically. If the user wants to override the default directory mode, they can create directory entries by hand.

Possible future extensions:

  • Explicitly support a tree of systemd units. For now, users can write into /etc/systemd/system directly.
  • Add an option to copy directory modes.

Thoughts?

@dustymabe
Copy link
Member

seems reasonable to me

@cgwalters
Copy link
Member Author

What defines "files-dir"?

@dustymabe
Copy link
Member

does files-dir default to $PWD?

@bgilbert
Copy link
Contributor

bgilbert commented May 6, 2020

-d/--files-dir is added in #99, and does not have a default. The idea is that we should never inject files from the filesystem without the user explicitly requesting it. That matters for hosted FCCT services, and arguably also for users pasting malicious FCCs from the Internet.

@bgilbert bgilbert added this to the FCC Spec 1.1.0 milestone May 6, 2020
@bgilbert bgilbert added jira enhancement New feature or request labels May 7, 2020
@lucab
Copy link
Contributor

lucab commented May 7, 2020

@bgilbert in your proposal, how is user/group ownership handled?

@bgilbert
Copy link
Contributor

bgilbert commented May 7, 2020

They wouldn't be set by default (so, root/root), but could be overridden on a per-file basis by creating a file node without contents but with the user/group set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request jira
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants