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

[RPM M4] Publish YUM repository #1549

Closed
Tracked by #27
peterzhuamazon opened this issue Jan 25, 2022 · 16 comments
Closed
Tracked by #27

[RPM M4] Publish YUM repository #1549

peterzhuamazon opened this issue Jan 25, 2022 · 16 comments
Assignees
Labels

Comments

@peterzhuamazon
Copy link
Member

peterzhuamazon commented Jan 25, 2022

Tasks Estimate Status Notes Dependencies
Deploy the RPM packages into a local YUM repository on a build system 3 Complete The RPM package needs to be ready see #1549 (comment)
The metadata files for the entire repo will be generated and staged in the repo 2 Complete Need to figure out whether createrepo is the best way to do this same as above
The build system should try to install the RPM packages through the local remote repo and verify the commands running correctly 2 Complete (We moved the local yum repo to remote staging yum repo) The YUM repo needs to be ready same as above
The build system should attempt to start the service of the installed packages and verify the outcome through process manager of the service (see more details in the test requirements) 2 Please track in #1555 see #1549 (comment)
Once verified, the entire repo should be uploaded to the dedicated production S3 bucket linked to artfacts.opensearch.org 2 Complete  
A repo file is also generated (once every major release) and updated on our website, for user to download and deploy on their host / server 1 Complete    
Once deployed, user can then use YUM command to install the latest RPM packages from our repository on S3, with the help of CloudFront cache in the front 2 Complete    
@peterzhuamazon peterzhuamazon changed the title Publish YUM repository [RPM M4] Publish YUM repository Feb 21, 2022
@peterzhuamazon peterzhuamazon self-assigned this Mar 23, 2022
@peterzhuamazon
Copy link
Member Author

peterzhuamazon commented Mar 23, 2022

Yum local repo:

[testrepo]
name=testrepo
baseurl=file:///opt/test
enabled=1
gpgcheck=0
sudo yum install opensearch
Loaded plugins: priorities, remove-with-leaves
1167 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package opensearch.x86_64 0:1.3.0-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================================================================================================================================================================================
 Package                                                                        Arch                                                                       Version                                                                     Repository                                                                      Size
============================================================================================================================================================================================================================================================================================================================
Installing:
 opensearch                                                                     x86_64                                                                     1.3.0-1                                                                     testrepo                                                                     354 M

Transaction Summary
============================================================================================================================================================================================================================================================================================================================
Install  1 Package

Total download size: 354 M
Installed size: 596 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : opensearch-1.3.0-1.x86_64                                                                                                                                                                                                                                                                                1/1
opensearch-security
### NOT starting on installation, please execute the following statements to configure opensearch service to start automatically using systemd
 sudo systemctl daemon-reload
 sudo systemctl enable opensearch.service
### You can start opensearch service by executing
 sudo systemctl start opensearch.service
### Created opensearch demo certificates in /etc/opensearch/certs
 See demo certs creation log in /var/log/opensearch/install_demo_configuration.log
  Verifying  : opensearch-1.3.0-1.x86_64                                                                                                                                                                                                                                                                                1/1

Installed:
  opensearch.x86_64 0:1.3.0-1

@peterzhuamazon
Copy link
Member Author


% sudo systemctl start opensearch.service

(22-03-23 23:30:07) <0> [/opt]
% sudo systemctl status opensearch.service
● opensearch.service - OpenSearch
   Loaded: loaded (/usr/lib/systemd/system/opensearch.service; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2022-03-23 23:30:07 UTC; 7s ago
     Docs: https://opensearch.org/
 Main PID: 25282 (java)
    Tasks: 79
   Memory: 1.2G
   CGroup: /system.slice/opensearch.service
           └─25282 /usr/share/opensearch/jdk/bin/java -Xshare:auto -Dopensearch.networkaddress.cache.ttl=60 -Dopensearch.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -XX:+ShowCodeDetailsInExceptionMe...

Mar 23 23:29:55 <>.<> systemd[1]: Starting OpenSearch...
Mar 23 23:29:57 <>.<> systemd-entrypoint[25282]: WARNING: A terminally deprecated method in java.lang.System has been called
Mar 23 23:29:57 <>.<> systemd-entrypoint[25282]: WARNING: System::setSecurityManager has been called by org.opensearch.bootstrap.OpenSearch (file:/usr/share/opensearch/lib/opensearch-1.3.0.jar)
Mar 23 23:29:57 <>.<> systemd-entrypoint[25282]: WARNING: Please consider reporting this to the maintainers of org.opensearch.bootstrap.OpenSearch
Mar 23 23:29:57 <>.<> systemd-entrypoint[25282]: WARNING: System::setSecurityManager will be removed in a future release
Mar 23 23:29:58 <>.<> systemd-entrypoint[25282]: WARNING: A terminally deprecated method in java.lang.System has been called
Mar 23 23:29:58 <>.<> systemd-entrypoint[25282]: WARNING: System::setSecurityManager has been called by org.opensearch.bootstrap.Security (file:/usr/share/opensearch/lib/opensearch-1.3.0.jar)
Mar 23 23:29:58 <>.<> systemd-entrypoint[25282]: WARNING: Please consider reporting this to the maintainers of org.opensearch.bootstrap.Security
Mar 23 23:29:58 <>.<> systemd-entrypoint[25282]: WARNING: System::setSecurityManager will be removed in a future release
Mar 23 23:30:07 <>.<> systemd[1]: Started OpenSearch.
% curl https://localhost:9200 -u admin:admin --insecure
{
  "name" : "<>",
  "cluster_name" : "opensearch",
  "cluster_uuid" : "jVINa77LSieQakeeuQgRKQ",
  "version" : {
    "distribution" : "opensearch",
    "number" : "1.3.0",
    "build_type" : "rpm",
    "build_hash" : "54c7206d8cba6973d19a814f2705e35ae5cc66db",
    "build_date" : "2022-02-19T17:16:28.462002Z",
    "build_snapshot" : false,
    "lucene_version" : "8.10.1",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "The OpenSearch Project: https://opensearch.org/"
}

@setiah
Copy link
Contributor

setiah commented Mar 25, 2022

This looks good. In addition, we might need to define more nuances around version upgrade for both minor and major version upgrades. For instance, does a yum update also take care of copying data dir/ from existing to the latest installed version? (i believe not!) Same goes for config and certificates. Without data and config, the new version might start fresh and may not even join the cluster. We may need to document the steps users need to take for minor and major version update via yum.

@peterzhuamazon
Copy link
Member Author

peterzhuamazon commented Mar 25, 2022

This looks good. In addition, we might need to define more nuances around version upgrade for both minor and major version upgrades. For instance, does a yum update also take care of copying data dir/ from existing to the latest installed version? (i believe not!) Same goes for config and certificates. Without data and config, the new version might start fresh and may not even join the cluster. We may need to document the steps users need to take for minor and major version update via yum.

I specifically designed that data folder wont get touch during any upgrade, downgrade, installation.
Also setup config so that any configs that diffs between older and newer will retain the original copy, and move new one to something like config.new.

@peterzhuamazon
Copy link
Member Author

peterzhuamazon commented Apr 11, 2022

I have synced up with @tianleh on the current design of staging yum.

  1. Each build with have 4 yum repo + repofile, os_x64, os_arm64, osd_x64, osd_arm64.
  2. No signing for staging for both repo signing and rpm signing.
  3. When testing upgrade, only testing within major version number. We can test 1.2.4 to 1.3.1, 1.3.0 to 1.3.1, no 1.x to 2.x.
  4. When testing upgrade, install all the repo files that related to the versions in the test, say 1.2.4 to 1.3.1, we will install 1.2.4 * 4repofiles, 1.3.1 * 4repofiles, then install 1.2.4 1st, add some shards, then upgrade 1.3.1, verify state.

More to come.

20220411:

@peterzhuamazon
Copy link
Member Author

peterzhuamazon commented Apr 13, 2022

We are seeing an issue where rpm itself does not support adding - to separate 3 digit version and its qualifier.
http://ftp.rpm.org/max-rpm/ch-rpm-file-format.html

The version number is normally taken verbatim from the package's version. The only restriction placed on the version is that it cannot contain a dash "-".

Support:

2.0.0alpha1
2.0.0.alpha1
2.0.0~alpha1
2.0.0_alpha1

Not Support:

2.0.0-alpha1

This means the even though the rpm file name shows opensearch-2.0.0-alpha1-linux-x64.rpm.
When install you can only use yum install opensearch or yum install opensearch-2.0.0 not yum install opensearch-2.0.0-alpha1.

Test results:
#1960 (comment)

Thanks.

@CEHENKLE @bbarani @tianleh

@dblock
Copy link
Member

dblock commented Apr 13, 2022

What's the issue? What happens when I yum install opensearch-2.0.0-alpha1?

So the tool, rpmbuild doesn't agree with semver? semver/semver#145 ugh

@peterzhuamazon
Copy link
Member Author

@dblock rpm does not support dash so its build tool rpmbuild also not supporting it.
You can see a full page of people discussing this.
semver/semver#145

Thanks.

@peterzhuamazon
Copy link
Member Author

I would say ~ is the closest to - we can have.
If we have 2.0.0-alpha1 on filename and 2.0.0~alpha1 in rpm metadata then these are supported.

yum install opensearch
yum install opensearch-2.0.0~alpha1
yum install "opensearch-*"
yum install "opensearch-2.0.0*"
yum install "opensearch-2.0.0*alpha1"

And yes this one is not supported at all, because rpm does not have qualifier field and treat 2.0.0~alpha1 its entirety as the version number:

yum install "opensearch-2.0.0"
yum install "opensearch-"

If we do not have ~ or + as you see in above link I provided, there can potentially be a sorting issue in yum repo and cause installation not able to find latest rpm in yum

More explanation: semver/semver#145 (comment)

We also need to check more on this as deb apparently support - (?) according to the discussion.
So if we change rpm we probably need to check if later on deb wants to follow the same or not.

Thanks.

@dblock
Copy link
Member

dblock commented Apr 13, 2022

My initial reaction is to do this.

@peterzhuamazon
Copy link
Member Author

peterzhuamazon commented Apr 13, 2022

My initial reaction is to do this.

We have some replacements here I think:

~
+
.

Do you think . is the best one here?

@dblock
Copy link
Member

dblock commented Apr 13, 2022

Personally, I like + because currently we have - and + seems mathematically related. Don't have a strong opinion.

@peterzhuamazon
Copy link
Member Author

According to the post seems like . is suited for qualifier while + suited for snapshot.
I actually like to combine . and + so rpm can support both qualifier and snapshot.
Thanks.

@peterzhuamazon
Copy link
Member Author

peterzhuamazon commented Apr 13, 2022

@CEHENKLE
Copy link
Member

Although there are many, this is not among the hills I am willing to die on ;) Probably not petty enough? ;)

If it's possible, and I think it is, we should do the same thing for both opensearch dashboards and opensearch. I like the idea of . for the qualifier while + for snapshot.

Can we do that for both groups?

@peterzhuamazon
Copy link
Member Author

peterzhuamazon commented Apr 20, 2022

We have completed the staging yum repo but production is not ready, track in #2014.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants