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

Unbundle installation of components not common to the majority of users #306

Open
ksbhaskar opened this issue Jul 11, 2018 · 2 comments
Open

Comments

@ksbhaskar
Copy link
Member

ksbhaskar commented Jul 11, 2018

Final Release Note

Description

For production deployments, it is recommended that only the minimum required components/files/functions be installed; to build up what is needed rather than to strip out what is not needed. To that end:

  • While the traditional usage of YottaDB has been M applications, the trend is towards non-M applications. Ergo, the installation of YottaDB components that are primarily useful to M applications should be optional rather than automatic.
  • Functionality that is not commonly used should be optional.

YottaDB components useful primarily to M users are:

  • Unicode support: UTF-8 mode is primarily useful to M programs. Programs written in C and other languages manage character encoding in non-M application code, and use YottaDB only to store and receive data.
  • M help: the gtmhelp.dat database file.
  • Utility programs (“% routines”) fall roughly into two categories: those used to configure, and manage the database, and those used by and to manage MUMPS programs. While routines used used to configure and manage the database (such as GDE, the global utilities, and system management utilities) are relevant to all users of YottaDB, others (date and time utilities, conversion utilities, mathematic utilities, string utilities, routine utilities, and Unicode utilities) are relevant only to M applications.

Furthermore:

  • As the majority of YottaDB applications do not use database encryption the source.tar for the encryption plugin can be optionally installed.
  • The %DSEWRAP utility is deprecated, and its installation can be optional.

Of course, any components in the above that are used by non-M users should not be optional. For example, if there is content in gtmhelp.dat that is used by %PEEKBYNAME() that content should not be optional, even if the content relating to M programming is optional.

As a fringe benefit for those environments where space is tight, this should trim a few MB from an installed YottaDB directory.

Draft Release Note

Installation of components not used by the majority of users is optional, where previously they were automatic. The ydbinstall.sh script supports the following options:

  • --encplugin – compile and install the encryption plugin
  • --deprecated – install deprecated components, specifically %DSEWRAP
  • --full – equivalent to: --encplugin --mprog --posix --utf8 all --zlib
  • --mprog – install components useful to M applications, viz. date and time utilities, conversion utilities, mathematic utilities, string utilities, routine utilities, and Unicode utilities; help content relevant to M application code
  • --posix – download and install the POSIX plugin
  • --zlib – download and install the zlib plugin

Note that Unicode support is already optional, invoked with the --utf8 command line option, and ydbinstall.sh --help provides a list of all options. [#306]

@ksbhaskar
Copy link
Member Author

I inadvertently submitted the issue before I finished entering the Description and Draft Release Note. Done now.

@ksbhaskar
Copy link
Member Author

The encryption plugin directory is $ydb_dist/plugin/gtmcrypt. A subdirectory name like crypt or ydbcrypt would be more appropriate. Also it needs to exist only if & when the encryption plugin is installed, and can be created by ydbinstall.sh if the --encplugin option is specified.

nars1 pushed a commit that referenced this issue Dec 3, 2019
nars1 added a commit that referenced this issue Aug 11, 2020
…o fail with YDB-E-SYSCALL errors

* `ydbinstall.sh` was observed to fail with the below error when one tried to install YDB as well as at
  least one plugin (posix, zlib, encryption plugin).

  ```
  + echo Error file at /tmp/ydb_env_20174_GQOTSJ is:
  Error file at /tmp/ydb_env_20174_GQOTSJ is:
  + cat /tmp/ydb_env_20174_GQOTSJ/err
  %YDB-E-SYSCALL, Error received from system call getcwd -- called from module sr_port/setzdir.c at line 70
  %YDB-I-TEXT, No such file or directory
  ```

* Turns out it is a regression introduced in a prior commit (acb8b27).
  Before that commit, ydbinstall.sh did a `rm -rf $tmpdir` at the end of the script once it knew YottaDB
  was successfully installed. But as part of that commit, code was added to install the plugins (if they
  were specified as part of the ydbinstall.sh command line) AFTER the location where the `rm -rf $tmpdir`
  happened. And each plugin installation had a `ydb_env_set` invocation to start with.

  Because of the `rm -rf $tmpdir`, each of these `ydb_env_set` invocations happened in a non-existent
  directory. And this is the source of the `getcwd()` failure and the resultant `YDB-E-SYSCALL` errors.

* This is now fixed by moving the `rm -rf $tmpdir` to the new end of the ydbinstall.sh script AFTER the
  plugin install code. Each plugin install records whether it succeeded or not. If any plugin install
  fails, the `rm -rf $tmpdir` is not done at the end. If all plugin installs succeed, only then is it done.

* In addition, the exit status of ydbinstall.sh is now fixed to be 0 if all plugin installs succeed and
  1 (a non-zero value) if at least one plugin install failed.

* Fixed a sh syntax error in a `"default" = $ydb_icu_version` check. Surrounded the `$ydb_icu_version`
  usage in double-quotes. Or else one got a `./ydbinstall.sh: 896: [: =: argument expected` error.
nars1 pushed a commit that referenced this issue Aug 18, 2021
…t repo

This commit makes the changes necessary to move the encryption plugin from the YDB repo to the YDBEncrypt repo.

* Deleting encryption plugin related files from the YDB repo unless they are needed for a YottaDB build.

* Modifying the ydbinstall script's `--encplugin` option to install the encryption plugin from the YDBEncrypt repo on gitlab

* Modifying the configure script to remove the commands that create an encryption plugin tarball in $ydb_dist

* Modifying CMakeLists to remove encryption plugin related targets

* Modifies the pre-commit hook to print an alert during the commit if changes in the YDBEncrypt repo are needed (such as during upstream version merges and changes to files needed by both YDB and YDBEncrypt)
nars1 added a commit that referenced this issue Oct 25, 2022
…ermission set

Background
----------
* The below is pasted from the issue description at https://gitlab.com/YottaDB/DB/YDB/-/issues/943#description

* See https://gitlab.com/YottaDB/DB/YDB/-/merge_requests/1022#note_1146940691 for details but the issue
  is that a lot of encryption related scripts had the execute permission removed from them as part of #306
  (released as part of YottaDB r1.34).

* The list of the scripts that are missing the execute permission is pasted below.

  ```sh
  $ ls -1 $ydb_dist/plugin/gtmcrypt/*.sh
  encrypt_sign_db_key.sh
  gen_keypair.sh
  gen_sym_hash.sh
  gen_sym_key.sh
  import_and_sign_key.sh
  pinentry-gtm.sh*
  show_install_config.sh
  ```

* All those scripts should have the execute permission set. But only `pinentry-gtm.sh` has it above as seen
  by the `*` suffix. This is a regression in 92daf75 that needs to be fixed.

Fix
---
* The fix is simple and is to do a `chmod +x` on all `*.sh` scripts in `$ydb_dist/plugin/ydbcrypt`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant