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

Migration and Update Guide for 5 to 7 #1029

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
bda0bde
Migration and Update Guide Changes
mmattel Oct 25, 2024
4d33718
overview update
mmattel Oct 27, 2024
7234243
ocis init --diff (not finished)
mmattel Oct 27, 2024
e335f89
update details (breaking changes)
mmattel Oct 27, 2024
83f4018
updates
mmattel Oct 28, 2024
3db96d8
Apply suggestions from code review
mmattel Oct 28, 2024
7d43f4b
add changed cli commands
mmattel Oct 28, 2024
d0075a0
more cli command updates
mmattel Oct 28, 2024
b2c9884
add searvice health
mmattel Oct 29, 2024
d2f7561
link service health
mmattel Oct 29, 2024
40e6066
text fixes
mmattel Oct 29, 2024
3cb4a4b
docker run changes
mmattel Oct 30, 2024
6c363aa
move cli changes
mmattel Oct 30, 2024
fd5ef9b
Apply suggestions from code review
mmattel Oct 30, 2024
b667915
cli restart and resume
mmattel Nov 4, 2024
d9523b4
small fixes
mmattel Nov 4, 2024
e26696a
update envvars changes
mmattel Nov 7, 2024
8fea923
numbered sections (unfinished)
mmattel Nov 8, 2024
619ed12
numbered sections (finished)
mmattel Nov 8, 2024
ef8ce22
update binary upgrade steps
mmattel Nov 11, 2024
0e8e22b
add note if patch command is missing
mmattel Nov 11, 2024
c3fa54a
Merge branch 'master' into migrate_5_to_7
mmattel Nov 13, 2024
80a3bc2
add collaboration related stuff
mmattel Nov 13, 2024
734fee2
fix collaboration reason
mmattel Nov 13, 2024
d5f058c
fixes service health text
mmattel Nov 14, 2024
fab442c
Merge branch 'master' into migrate_5_to_7
mmattel Nov 14, 2024
ed37ccb
docs: avoid sloppy language. Throu -> trough; dangling adverb 'first'…
jnweiger Nov 14, 2024
e1be535
Merge pull request #1049 from owncloud/language-review-5-7
mmattel Nov 15, 2024
2360692
Apply suggestions from code review
mmattel Nov 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ asciidoc:

# this is the first part of the name for envvars between major versions that will be added or removed
# example for full name: 4.0.0-5.0.0-added.adoc or 4.0.0-5.0.0-removed.adoc
env_var_delta_name: '4.0.0-5.0.0'
env_var_delta_name: '5.0.0-7.0.0'

# helm_tab_x will be used to assemble the url (tag) accessing the raw content for helm charts (tag)
# note that tab 2 always contains the actual release and tab 3 the former
Expand Down
15 changes: 15 additions & 0 deletions modules/ROOT/pages/depl-examples/bare-metal.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,21 @@ Note that this URL must resolve to the server running this installation.

=== Install and configure the Infinite Scale Binary

[NOTE]
====
If you have installed Infinite Scale already but want to upgrade it, do the following steps first:

* xref:stopping-infinite-scale[Stop infinite Scale]: +
You cannot overwrite the binary of a running instance.

* Make a copy of the existing binary first:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making a copy in this way does not help. the original binary file is still locked for swapping by the kernel.

I'd prefer to move away the running binary - then we can add a new version with the original name.
E.g. the following commands can be done without stopping ocis:

  wget -P /usr/local/bin https://download.owncloud.com/ocis/ocis/testing/7.0.0-rc.1/ocis-7.0.0-rc.1-linux-amd64
  chmod a+x /usr/local/bin/ocis-7.0.0-rc.1-linux-amd64
  mv /usr/local/bin/ocis /usr/local/bin/ocis-5.0.8      # it can happily continue to run under this name.
  ln -s ocis-7.0.0-rc.1-linux-amd64 /usr/local/bin/ocis

  ocis version --skip-services
    Version: 7.0.0-rc.1
    Compiled: 2024-11-07 00:00:00 +0000 UTC

The symlink is used here to document the versions, active and inactive.
(A simpler sequence - with a longer absence - would just use wget -O after mv.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This procedure is a good idea, if that works - needs testing, I like it.
With that, we can easily switch versions and keep track of original naming.

Copy link
Contributor

@jnweiger jnweiger Nov 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine -- for me 🤷‍♂️ at least.
I simply avoid the ETXTBSY overwrite by moving the old binary away. That works, because a busy text file is about the inode of the file, not the name of the file (kernel only cares about inodes here).

Symlinks sometimes cause confusion; but here it looks smooth, and I could not think of anything that would break.

(All this is still not an atomic upgrade. The technically best approach is to use a hardlink and a rename system call.)

+
[source,bash,subs="attributes+"]
----
sudo cp {ocis_bin}/ocis {ocis_bin}/ocis.old
----
====

* Download and install the Infinite Scale binary. To get the stable binary from ownCloud, visit {ocis-downloadpage-url}/{download-type}/?sort=time&order=desc[download.owncloud.com,window=_blank], select the version and the platform of choice and copy the link of the file.
+
[source,bash,subs="attributes+"]
Expand Down
15 changes: 15 additions & 0 deletions modules/ROOT/pages/depl-examples/minimal-bare-metal.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@ Congratulations, you now have access to your Infinite Scale instance.

== Installation

[NOTE]
====
If you have installed Infinite Scale already but want to upgrade it, do the following steps first:

* xref:stopping-infinite-scale[Stop infinite Scale]: +
You cannot overwrite the binary of a running instance.

* Make a copy of the existing binary first:
+
[source,bash,subs="attributes+"]
----
sudo cp {ocis_bin}/ocis {ocis_bin}/ocis.old
----
====

* To get the stable binary from ownCloud, visit {ocis-downloadpage-url}/{download-type}/?sort=time&order=desc[download.owncloud.com,window=_blank], select the version and the platform of choice and copy the link of the file. Check the sort order on the modification date to get the most recent releases on top. Depending on your system and preferences, you may want to save the binary in `{ocis_bin}`.
+
--
Expand Down
10 changes: 6 additions & 4 deletions modules/ROOT/pages/deployment/general/general-info.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -622,13 +622,15 @@ An admin user will be created when running the `ocis init` command with the foll

Login to the webinterface with this admin user and change relevant data according your needs or create new users. As an example to reach out the webinterface use `\https://localhost:9200`.

=== Password Reset for the Admin User
=== Password Reset for IDM Users

The admin password can be reset via command line if it has been forgotten and the admin can't enter the webUI anymore. Note that the admin user must already exist which happens if you have xref:deployment/general/ocis-init.adoc[initialized Infinite Scale].

After running the respective command and entering a new password, the admin can relogin using the new password.
See the command below for details and options.

After running the respective command and entering a new password, the admin or user can relogin using the new password.

Note that when Infinite Scale gets initialized with xref:deployment/general/ocis-init.adoc[The ocis init Command], an admin password is created and stored in the `ocis.yaml` file. The lifespan of this admin password is up to the point when it either gets changed in the webUI or via the resetpassword command. Any admin password changes are NOT written back to the `ocis.yaml` file nor manual changes to the `admin_password` are considered as a new password.
Note that when Infinite Scale gets initialized with xref:deployment/general/ocis-init.adoc[The ocis init Command], an admin password is created and stored in the `ocis.yaml` file. The lifespan of this admin password is up to the point when it either gets changed in the webUI or via the resetpassword command. Any admin password changes are *NOT* written back to the `ocis.yaml` file nor manual changes to the `admin_password` are considered as a new password.

[source,yaml]
----
Expand Down Expand Up @@ -657,7 +659,7 @@ When the prerequisite from the note above is fulfilled, you can reset the admin

==== Binary Setup

Run the following command to reset the admin password:
Run the following command to reset the admin password, use `--user-name <user>` for ordinary users:

[source,bash]
----
Expand Down
9 changes: 7 additions & 2 deletions modules/ROOT/pages/deployment/services/env-var-changes.adoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Changed Environment Variables in Versions
:toc: right
:description: This page contains tables with added and removed environment variables between Infinite Scale version 4.0.0 and 5.0.0.
:description: This page contains tables with added and removed environment variables between Infinite Scale version 5.0.x and 7.0.0.

:source_path: {ocis_services_raw_url}{service_url_component}{ocis_services_final_path}adoc/env-var-deltas/
// https://raw.githubusercontent.com/owncloud/ocis/docs-stable-5.0/services/_includes/adoc/env-var-deltas/
// https://raw.githubusercontent.com/owncloud/ocis/docs-stable-7.0/services/_includes/adoc/env-var-deltas/

== Introduction

Expand All @@ -23,4 +23,9 @@ Removed::
--
include::{source_path}{env_var_delta_name}-removed.adoc[]
--
Deprecated::
+
--
include::{source_path}{env_var_delta_name}-deprecated.adoc[]
--
====
54 changes: 44 additions & 10 deletions modules/ROOT/pages/deployment/services/s-list/postprocessing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,39 +63,73 @@ The backoff behavior as mentioned in the `retry` outcome can be configured using

=== Resume Post-Processing

If post-processing fails in one step due to an unforeseen error, current uploads will not be retried automatically. A system administrator can instead run CLI commands to retry the failed upload which is a two step process. For details on the `storage-users` command see the xref:{s-path}/storage-users.adoc#manage-unfinished-uploads[Manage Unfinished Uploads] documentation.
[NOTE]
====
If not noted otherwise, commands with the `restart` option can also use the `resume` option. This changes behaviour slightly.

* First list ongoing upload sessions:
* `restart` +
When restarting an upload, all steps for open items will be restarted, except if otherwise defined.
* `resume` +
When resuming an upload, processing will continue unfinished items from their last completed step.
====

If post-processing fails in one step due to an unforeseen error, current uploads will not be resumed automatically. A system administrator can instead run CLI commands to resume the failed upload manually which is at minimum a two step process.

NOTE: For details on the `storage-users` command which provides many options see the xref:{s-path}/storage-users.adoc#manage-unfinished-uploads[Manage Unfinished Uploads] documentation.

Depending if you want to restart/resume all or defined failed uploads, different commands are used.

* First, list ongoing upload sessions to identify possibly failed ones. +
Note that there never can be a clear identification of a failed upload session due to various reasons causing them. You need to apply more critera like free space on disk, a failed service like antivirus etc. to declare an upload as failed.
+
[source,bash]
----
ocis storage-users uploads sessions
----

* If you want to restart *all* uploads, just rerun the command with the `--restart` flag:
{empty}

* *All failed uploads*
+
--
If you want to restart/resume all failed uploads, just rerun the command with the relevant flag. Note that this is the preferred command to handle failed processing steps:

[source,bash]
----
ocis storage-users uploads sessions --restart
ocis storage-users uploads sessions --resume
----
{empty}
--

* If you want to restart *only one* upload, use the postprocessing restart command with the ID selected:
* *Particular failed uploads* +
Use the `postprocessing` command to resume defined failed uploads. For postprocessing steps, the default is to resume . Note that at the moment, `resume` is an alias for `restart` to keep old functionality. `restart` is subject of change and will most likely be removed in a later version.

** *Defined by ID*
+
--
If you want to resume only a specific upload, use the postprocessing resume command with the ID selected:

[source,bash]
----
ocis postprocessing restart -u <uploadID>
ocis postprocessing resume -u <uploadID>
----
{empty}
--

Alternatively, instead of starting one specific upload, a system admin can also restart all uploads that are currently in a specific step.
** *Defined by step*
+
--
Alternatively, instead of restarting one specific upload, a system admin can also resume all uploads that are currently in a specific step.

Examples:

[source,bash]
----
ocis postprocessing restart # Restarts all uploads where postprocessing is finished, but upload is not finished.
ocis postprocessing restart -s "finished" # Equivalent to the above.
ocis postprocessing restart -s "virusscan" # Restart all uploads currently in virusscan step.
ocis postprocessing resume # Resumes all uploads where postprocessing is finished, but upload is not finished.
ocis postprocessing resume -s "finished" # Equivalent to the above.
ocis postprocessing resume -s "virusscan" # Resume all uploads currently in virusscan step.
----
--

== Storing

Expand Down
27 changes: 18 additions & 9 deletions modules/ROOT/pages/deployment/services/s-list/storage-users.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ IMPORTANT: The graceful shutdown period is only applicable if the `storage-users

When hard-stopping Infinite Scale, for example with the `kill <pid>` command (SIGKILL), it is possible and likely that not all data from the decomposedfs (metadata) has been written to the storage which may result in an inconsistent decomposedfs. When gracefully shutting down Infinite Scale, using a command like SIGTERM, the process will no longer accept any write requests from _other_ services and will try to write the internal open requests which can take an undefined duration based on many factors. To mitigate that situation, the following things have been implemented:

* With the value of the environment variable `STORAGE_USERS_GRACEFUL_SHUTDOWN_TIMEOUT`, the `storage-users` service will delay its shutdown giving it time to finalize writing necessary data. This delay can be necessary if there is a lot of data to be saved and/or if storage access/thruput is slow. In such a case you would receive an error log entry informing you that not all data could be saved in time. To prevent such occurrences, you must increase the default value.
* With the value of the environment variable `STORAGE_USERS_GRACEFUL_SHUTDOWN_TIMEOUT`, the `storage-users` service will delay its shutdown giving it time to finalize writing necessary data. This delay can be necessary if there is a lot of data to be saved and/or if storage access/throughput is slow. In such a case you would receive an error log entry informing you that not all data could be saved in time. To prevent such occurrences, you must increase the default value.

* If a shutdown error has been logged, the command-line maintenance tool xref:maintenance/commands/commands.adoc#inspect-and-manipulate-node-metadata[Inspect and Manipulate Node Metadata] can help to fix the issue. Please contact support for details.

Expand Down Expand Up @@ -69,22 +69,30 @@ ocis storage-users uploads <command>
----
COMMANDS:
sessions Print a list of upload sessions
clean Clean up leftovers from expired uploads (deprecated, do not use it)
list Print a list of all incomplete uploads (deprecated, do not use it)
----
--

==== Sessions command

The `sessions` command is the entry point for listing, restarting and cleaning unfinished uploads.
The `sessions` command is the entry point for listing, restarting/resuming and cleaning unfinished uploads.

NOTE: There can never be a clear identification of a failed upload session due to various reasons causing them. You need to apply more critera like free space on disk, a failed service like antivirus etc. to declare an upload as failed.

[NOTE]
====
If not noted otherwise, the `restart` option can also be replaced the `resume` option. This changes behaviour slightly.

* `restart` +
When restarting an upload, all steps for open items will be restarted, except if otherwise defined.
* `resume` +
When resuming an upload, processing will continue unfinished items from their last completed step.
====

[source,bash]
----
ocis storage-users uploads sessions
----

Note, though possible, do not use the deprecated upload commands listed above. Their function has been embedded in the session command as command options.

[source,plaintext]
----
NAME:
Expand All @@ -100,6 +108,7 @@ OPTIONS:
--has-virus filter sessions by virus scan result (default: unset)
--json output as json (default: false)
--restart send restart event for all listed sessions (default: false)
--resume send resume event for all listed sessions (default: false)
--clean remove uploads (default: false)
--help, -h show help
----
Expand Down Expand Up @@ -165,7 +174,7 @@ ocis storage-users uploads sessions --expired=false --processing=false
|
|===

The sessions command can also clear and restart uploads. The output is the same as if run without the `--clean` or `--restart` flag. Note that it is recommended to run the command first without the `--clean` (`--processing`) flag to double check which uploads get cleaned (restarted).
The sessions command can also clear and restart/resume uploads. The output is the same as if run without the `--clean` or `--restart/--resume` option. Note that it is recommended to run the command first without the `--clean` (`--processing`) option to double check which uploads would get cleaned (restarted/resumed).

.Cleans all expired uploads regardless of processing and virus state.
[source,bash]
Expand All @@ -175,13 +184,13 @@ ocis storage-users uploads sessions \
--clean
----

.Restarts all uploads that are processing and are not virus infected
.Resume all uploads that are currently processing and are not virus infected
[source,bash]
----
ocis storage-users uploads sessions \
--processing=false \
--has-virus=false \
--restart
--resume
----

=== Manage Trash-Bin Items
Expand Down
37 changes: 37 additions & 0 deletions modules/ROOT/pages/maintenance/commands/changed-cli.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
= Changed or Added CLI Commands
:toc: right
:description: This page contains a list with added, changed or removed CLI commands between Infinite Scale version 5.0.x and 7.0.0.

== Introduction

{description}

== Affected CLI Commands

See the link for a detailed description of the respective CLI command if available.

* xref:maintenance/commands/commands.adoc#manage-expired-uploads[Manage Expired Uploads] +
The `ocis storage-users uploads sessions --restart` command got an alternative `--resume` option. +
Resume can be used in the same way as restart with a slighly different behavior change.

* xref:maintenance/commands/commands.adoc#purge-expired-space-trash-bin-items[Purge Expired Space Trash-Bin Items] +
The `ocis storage-users uploads` got restructured. +
The deprecated `list` option is now removed, the `clean` option is now part of the `sessions command`.

* xref:maintenance/commands/commands.adoc#resume-post-processing[Resume Post-Processing] +
The `ocis postprocessing restart` command got an alternative `resume` option. +
Resume can be used in the same way as restart with a slighly different behavior change.

* xref:maintenance/commands/commands.adoc#reset-password-for-idm-users[Reset Password for IDM Users] +
The `ocis idm resetpassword` can now specify the user name via the `--user-name` (`-u`) flag.

* xref:maintenance/commands/commands.adoc#revisions-cleanup[Revisions Cleanup] +
The `ocis revisions purge` command allows removing revisions of files in the storage. Note that this command has also been backported to version 5 available with its latest release.

* xref:maintenance/commands/commands.adoc#service-health[Service Health] +
A `health` command has been added to each service: `ocis <service-name> health`.

* xref:maintenance/commands/commands.adoc#trash-purge[Trash Purge]. +
The `ocis trash purge-empty-dirs` command allows removing empty folders from the trashbin.

* The `ocis graph list-unified-roles` command simplifies the process of finding out which UID belongs to which role. Note that this command is described in the https://github.com/owncloud/ocis/tree/master/ocis#list-unified-roles[ocis repository, window=_blank] and has been added for completeness only.
Loading