-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix non legacy build/docker issues plus dev to rpm install mechanism #…
…1989 Fix a number of the remaining build and docker issues concerning the proposed move to openSUSE as an upstream linux ditro base. Includes a fix to facilitate moving from a developer (source) install to an rpm based one: currently this only supports our existing legacy CentOS base, pending the instantiation of an openSUSE rpm build backend along with related distro aware repository config code changes. Docker specific notes: Many more modern dockerd invocations require a number of command line arguments. Previously we passed, from the docker.service file, only one: our --data-root target. The included modifications allows for more custom or distro specific requirements to be met via accommodation of any number of arguments (unfiltered). All prior Rockstor specific dockerd arguments are preserved and applied as before. Summary: - Add dependency on python ‘distro’ library. - Store build system distro info in django settings, the assumption here is we build on our target distro: normally the case. - Add distro UI element, uses prior 2 items. - Normalise prior UI subheader linux info formatting. - Remove prior incorrect data_collector code comment. - Selectively run postgresql-setup (legacy) or initdb (non legacy) in initrock. - Update psycopg2 from 2.6 to 2.7.4. - Normalise on direct paths for commands: avoids redundant fs redirection ie in CentOS root we have “/bin -> /usr/bin" and "/sbin - > /usr/sbin"; as these dir links are not found in our non legacy base move all hard wired command paths using them to their canonical reference. - Use Django settings for a selection of variably located (distro specific) command paths: again with the assumption that we build on our target distro. - Fix version indicator and software update page display for dev (source) installs. - Fix dev (source install) to rpm install transition mechanism - necessarily considered as a re-install so db is wiped during the transition. Note that this, in part, involved the addition of an explicit 'yum install rockstor' command during update, along with ensuring that initrock is re-run on next rockstor.service start. - Add distro aware docker.service template file selection based on distro.id(); moving fully to a live edit (during Rock-on service enable) rather than build time customization: ie to accommodate for our docker wrapper redirect and it’s consequent requirement for NofityAccess=all for Type=notify docker configs. Both included openSUSE templates are taken from their respective distro default installs of docker-ce. - Establish docker-generic.service failover config for unknown distro ids taken from default upstream docker-ce 18.09 CentOS example. - Enhance docker wrapper to pass additional arguments to dockerd. - Minor additional rock-ons-root config exception logging. - Catch and log harmless reboot/shutdown command exceptions with rc=-15. The exception log reports from these Web-UI initiated events are misleading as they suggest malfunction where there is none as both commands execute as expected with: out='', err='', and rc=-15.
- Loading branch information
Showing
25 changed files
with
326 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Files with a name pattern of: docker-distroid.service | ||
|
||
where distroid = distro.id() | ||
|
||
are currently hand copied from their distro docker package origin, usually: | ||
/usr/lib/systemd/system/docker.service | ||
|
||
src/rockstor/smart_manager/views/docker_service.py then stream edits them. | ||
|
||
See docker_service.py for pre-instantiation edit details. | ||
|
||
Auto edit is performed on Docker service enable event within Web-UI and | ||
attempts to honour all existing dockerd arguments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[Unit] | ||
Description=Docker Application Container Engine | ||
Documentation=https://docs.docker.com | ||
BindsTo=containerd.service | ||
After=network-online.target firewalld.service | ||
Wants=network-online.target | ||
|
||
[Service] | ||
Type=notify | ||
# the default is not to use systemd for cgroups because the delegate issues still | ||
# exists and systemd currently does not support the cgroup feature set required | ||
# for containers run by docker | ||
ExecStart=/usr/bin/dockerd -H unix:// | ||
ExecReload=/bin/kill -s HUP $MAINPID | ||
TimeoutSec=0 | ||
RestartSec=2 | ||
Restart=always | ||
|
||
# Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229. | ||
# Both the old, and new location are accepted by systemd 229 and up, so using the old location | ||
# to make them work for either version of systemd. | ||
StartLimitBurst=3 | ||
|
||
# Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230. | ||
# Both the old, and new name are accepted by systemd 230 and up, so using the old name to make | ||
# this option work for either version of systemd. | ||
StartLimitInterval=60s | ||
|
||
# Having non-zero Limit*s causes performance problems due to accounting overhead | ||
# in the kernel. We recommend using cgroups to do container-local accounting. | ||
LimitNOFILE=infinity | ||
LimitNPROC=infinity | ||
LimitCORE=infinity | ||
|
||
# Comment TasksMax if your systemd version does not supports it. | ||
# Only systemd 226 and above support this option. | ||
TasksMax=infinity | ||
|
||
# set delegate yes so that systemd does not reset the cgroups of docker containers | ||
Delegate=yes | ||
|
||
# kill only the docker process, not all processes in the cgroup | ||
KillMode=process | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[Unit] | ||
Description=Docker Application Container Engine | ||
Documentation=http://docs.docker.com | ||
After=network.target containerd.socket containerd.service lvm2-monitor.service SuSEfirewall2.service | ||
Requires=containerd.socket containerd.service | ||
|
||
[Service] | ||
EnvironmentFile=/etc/sysconfig/docker | ||
|
||
# While Docker has support for socket activation (-H fd://), this is not | ||
# enabled by default because enabling socket activation means that on boot your | ||
# containers won't start until someone tries to administer the Docker daemon. | ||
Type=notify | ||
ExecStart=/usr/bin/dockerd --containerd /run/containerd/containerd.sock --add-runtime oci=/usr/sbin/docker-runc $DOCKER_NETWORK_OPTIONS $DOCKER_OPTS | ||
ExecReload=/bin/kill -s HUP $MAINPID | ||
|
||
# Having non-zero Limit*s causes performance problems due to accounting overhead | ||
# in the kernel. We recommend using cgroups to do container-local accounting. | ||
LimitNOFILE=infinity | ||
LimitNPROC=infinity | ||
LimitCORE=infinity | ||
|
||
# Uncomment TasksMax if your systemd version supports it. | ||
# Only systemd 226 and above support this property. | ||
TasksMax=infinity | ||
|
||
# Set delegate yes so that systemd does not reset the cgroups of docker containers | ||
# Only systemd 218 and above support this property. | ||
Delegate=yes | ||
|
||
# This is not necessary because of how we set up containerd. | ||
#KillMode=process | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[Unit] | ||
Description=Docker Application Container Engine | ||
Documentation=http://docs.docker.com | ||
After=network.target lvm2-monitor.service SuSEfirewall2.service | ||
|
||
[Service] | ||
EnvironmentFile=/etc/sysconfig/docker | ||
|
||
# While Docker has support for socket activation (-H fd://), this is not | ||
# enabled by default because enabling socket activation means that on boot your | ||
# containers won't start until someone tries to administer the Docker daemon. | ||
Type=notify | ||
ExecStart=/usr/bin/dockerd --add-runtime oci=/usr/sbin/docker-runc $DOCKER_NETWORK_OPTIONS $DOCKER_OPTS | ||
ExecReload=/bin/kill -s HUP $MAINPID | ||
|
||
# Having non-zero Limit*s causes performance problems due to accounting overhead | ||
# in the kernel. We recommend using cgroups to do container-local accounting. | ||
LimitNOFILE=infinity | ||
LimitNPROC=infinity | ||
LimitCORE=infinity | ||
|
||
# Uncomment TasksMax if your systemd version supports it. | ||
# Only systemd 226 and above support this property. | ||
TasksMax=infinity | ||
|
||
# Set delegate yes so that systemd does not reset the cgroups of docker containers | ||
# Only systemd 218 and above support this property. | ||
Delegate=yes | ||
|
||
# This is not necessary because of how we set up containerd. | ||
#KillMode=process | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.