[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [atomic-devel] Running docker-storage-setup from a UI



​Adding Vivek, not sure he's on this list.​

docker-storage-setup includes an example conf file:
/usr/lib/docker-storage-setup/docker-storage-setup

Perhaps there are some other options to that should be exposed to the UI?

If it's helpful, here is an ansible I use to reprovision docker storage for testing.  I think most of this could (should?) probably be added to docker-storage-setup (maybe like you said a --force-wipe or --init-storage option).

>From the UI standpoint it would be great to be able to choose the storage driver as well (devicemapper or overlay).

---
- name: install docker
  yum: name={{ item }} state=latest
  with_items:
    - docker
    - atomic

- name: ensure docker is stopped
  service: name=docker state=stopped

- name: remove docker-pool if it exists
  lvol: vg=docker_vg lv=docker-pool state=absent force=yes

- name: remove docker_vg if it exists
  lvg: vg=docker_vg state=absent

- name: remove /dev/sdb1 pv
  command:  pvremove /dev/sdb1
  ignore_errors: True

- name: delete /dev/sdb1
  command: parted /dev/sdb rm 1
  ignore_errors: True

- name: dd over first 10MB
  command:  dd if=/dev/zero of=/dev/sdb bs=1M count=10 oflag=direct

- name: rm /etc/sysconfig/docker-storage
  file: path=/etc/sysconfig/docker-storage state=absent

- name: setup /etc/sysconfig/docker-storage-setup
  copy: src="" dest=/etc/sysconfig/docker-storage-setup

# https://github.com/projectatomic/docker-storage-setup/issues/114
- name: patch /usr/bin/docker-storage-setup for partitions > 2TB
  patch: >
    src=""
    dest=/usr/bin/docker-storage-setup

- name: start docker-storage-setup service
  service: name=docker-storage-setup state=started

- name: start docker service
  service: name=docker state=started




On Tue, Apr 12, 2016 at 8:09 AM, Marius Vollmer <marius vollmer redhat com> wrote:
Hi,

I am working on this:

    https://github.com/cockpit-project/cockpit/wiki/Atomic:-Docker-Storage

which is basically a UI inside Cockpit for docker-storage-setup.

I am not super far along, but I am getting to the point where the UI
will need to actually run docker-storage-setup.

- My basic idea is to write a new /etc/sysconfig/docker-storage-setup
  file and then run docker-storage-setup.  Is that the best approach for
  a UI?

- Docker-storage-setup needs to run non-interactively, but I think it
  can't do that right now, and asks confirmation for various things.
  Would it be acceptable to add a "--force-wipe" option to d-s-s, and
  maybe others?  I can do that at the same time as I write the code for
  the UI.

- Just showing the contents of /etc/sysconfig/docker-storage-setup in
  the UI as the current state of things is not really correct, since
  docker-storage-setup might not have run since it was last changed, or
  it might have failed.

  So I am thinking there could be something like

    # docker-storage-setup status
    /dev/vda: ok, shared with OS
    /dev/sda: ok
    /dev/sdb: Not yet set up!

    The Docker storage pool is not fully set up.  Run
    "docker-storage-setup" to complete the set up.

  This would output information about how things should be, and how they
  actually are.  (With an option for machine readable output.)  The
  above would be for VG="" and DEVS="/dev/sda /dev/sdb" where there was
  some sort of problem with /dev/sdb.

  The machine readable output could maybe look like

    # docker-storage-setup status -M
    /dev/vda:root
    /dev/sda:
    /dev/sdb:error=missing

  Or should we go full JSON right away?


What do you think?  Am I heading down the wrong path?  If nobody stops
me, I'll hopefully make some PRs soon for this, and we can discuss the
details there.




--

-- Jeremy Eder

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]