-
Notifications
You must be signed in to change notification settings - Fork 277
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
[Design] OpenSearch/Dashboards DEB/RPM Distribution Design Document #1452
Comments
Will the RPMs be signed, like the ODFE ones were? |
We generally sign everything we release, so let's make sure they are. |
... and will be they signed with a strong algorithm like SHA256? (Suggestion: they should). If it isn't it will prevents the use of the rpms / yum repo for install on Redhat / Centos 8 (replacements) when the machine is in FIPS mode, which is quite important for a segment of the user population and not something that can be resolved by 'turning it off'. Without SHA256, the rpm's won't install and there is no way of overriding on the dnf/yum command. Also, what repo will be they hosted out of? Will the repo have its metadata signed as well? |
@peterzhuamazon Do we have documentation on what the signer process produces, keys, etc.? If not let's make sure to add this to this repo. |
Please fix the URL on this line - it goes to a document that most of us don't have access to:
I'm not following the decision to include copies of the JDK and Node.JS runtime in the deb and rpm packages. You say it's so a user "does not need to install them manually", but the package manager would do this. I'd consider this a strength of package managers, not a burden. |
I'm a little confused by that as well. That is why I asked about what repo they will be serving it out of. I fear they will just post a bare RPM without dependencies or meant to fit into the standard package systems. Although, to be honest, I am not holding my breath as I starting asking some of these questions in June of last year (see #27), but no one ever answered. This project hasn't been the easiest to communicate with or the most transparent, unfortunately. |
This is the right time to ask ourselves what we want and clarify anything that's unclear. What should we be doing? Is there anything in #1443 that is not doing the right thing already (please CR)?
Nobody was working on RPM then, but we should have been able to answer signing questions in general, apologies. I opened #1502 to document what we do now, which should carry into RPM signing. |
Btw, I don't know how to answer "what repo they will be serving it out of". Does anyone? @bbarani or @peternied? |
The goals should be to make it easy for anybody who wants to directly download an rpm/deb package and install it, as well as to make it easy for the maintainers of repos to include OpenSearch deb/rpm packages in their repos. I wonder if the assumption that a single file meets all these needs is wrong. A couple of questions:
|
I am not going to pretend to be an expert on how elasticsearch/opensearch builds. I have some rudimentary background in packaging and understand some of the complexities, but not enough to critique the packaging implementation of the shell scripts, python scripts, etc... I can expand some on the 'what' should happen from my viewpoint, however. I believe we should strive for something similar in how elasticsearch operated: setup some repo in /etc/yum.repos.d/ (although if this wanted to be some already in place like EPEL in the case of redhat, that would be just fine by me) and run the yum/dnf install command with some list of packages (assumedly, opensearch and opensearch-dashboards as appropriate). The yum/dnf command would then process dependencies, install dependent packages, install the indicated opensearch package, and configure startup scripts (like the systemd service files, any required selinux call setups for the paths, etc...). Successive calls to yum/dnf update should install updates as available on the repo server and reload/restart services as appropriate. Calls specifying specific versions of opensearch (like 1.3) or some relation (like most current version <1.3 to stay on the 1.2 series bugfix) should be supported. Updates which change versions should automatically do any migration needed to support the new versions. All of the above should obviously work for supported platforms substituting relevant commands (like apt-get for yum/dnf). It appears that by the names of the DEB/RPM it seems like Debian and Red Hat flavor distributions are being explicitly supported, which appears sensible, but we should probably make that clear. Support for Red Hat should also include the restrictions for FIPS, which is officially supported by the Red Hat distribution. Pragmatically, I have seen that means that RPMs should be signed with strong algorithms (such as SHA256 instead of, or at least in addition to MD5) and that the repos serving the RPMs should similarly sign their metadata with SHA256 as well (repomd.xml.asc). These are needed to assure the integrity of the metadata which trigger updates and the updates themselves, the need of which should be readily apparent with supply chain attacks becoming prominent in discussions. |
@peterzhuamazon It was stated that this would be used for raising questions about the approach. While there appear to be a number of questions raised, it is a bit light on answers. Do you think some will be able to be given? |
@justchris1 The ODFE repo has its metadata signed... |
Is that the repo they are using? There had been a lot of talk of the forums of getting rid of the ODFE nomenclature, so it is unclear if they would use that repo or not. Of course, RPM had been a 1.0 GA feature that kept getting pushed and pushed through time. It wouldn't shock me that since no one seems to have any answers that this just keeps getting pushed to the right. I imagine this isn't of much value to Amazon. Others, like @dblock have also asked, but crickets continue to be the predominant sound heard. |
Hi All, We realized there were missing pieces in the initial proposal, which is why we appreciate your feedbacks to the post. If you search for Note: The PR associated with initial design is more of a POC code and not ready for production consumption. We will making multiple changes to the RPM distribution generation code corresponding to the milestones listed on the parent issue to meet the quality bar of the RPM artifact. Please let us know about your thoughts after reading through our new requirements. Thanks. |
@jcgraybill @dblock please also take a look in the Requirement section. |
Thanks @peterzhuamazon for providing an update with answers to everything that's been provided here. Those requirements and user experience details look good to me. |
Just one comment - no one at this point should ever install packages with "rpm" directly (and -ivh is particularly bad), but always use "yum" or "dnf". You can install a locally downloaded rpm by specifying the filename, e.g. |
Close this as our design is already done without any changes. |
Excited to see RPMs with the latest release! Is there a place where progress towards packaging deb files is tracked? |
DEB is out with the latest 2.5.0 release. Thanks. |
Hi everyone,
We want to give you more details on how we currently experiment/implement the assemble workflows of DEB/RPM packages for the future releases on OpenSearch/Dashboards.
Please feel free to use this as guidance for contributing on DEB/RPM, as well as raising questions about our approach.
Original Draft PR for RPM POC on OpenSearch and Dashboards
We currently have a draft PR for review: #1443.Thanks.
OpenSearch/Dashboards DEB/RPM Distribution Design Document
Introduction
Problem Statement
As of 2021/11, OpenSearch project only publish Tarball and Docker Images as part of the release artifacts. As a result, the community is asking for DEB/RPM packages from us, as it is an easy approach for LINUX users to deploy, run, and test OpenSearch Clusters alongside OpenSearch-Dashboards, without the complicated manual setups on Tarball. After some research, we clearly see the demands from the community and start to investigate the requirements/steps for supporting these new distributions.
Here is the Meta issue to track the progress.
Designed Features (Outdated as of 2022/01/24)
## Designed Features.deb
and.rpm
packages will be provided for users to download and install on their LINUX hosts.Assemble_workflow
changes to addDEB/RPM
distributions as part of the workflow, setup pre-requisite / requirements before a package is generated, and callPackaging
to generate the package.Packaging
changes to include a tool for packaging OpenSearch/Dashboards Distribution/Bundle into a package.Assemble_workflow
needs to provide--distribution
as an optional argument for the customer to specify which distribution to build. The argument is exposed toassemble.sh
. The default value of--distribution
is “tar”. We should also support “rpm”, “deb” and “zip” as options of distribution. (“deb” will be an option in later updates)Requirements (Updated as of 2022/01/24 with more details and milestones)
—distribution
parameter so the internal API call can show “rpm” text, instead of the default “tar” text, as well as removing tar related files--distribution
parameter, so that the assemble workflow knows which distribution to create based on the input artifacts from build workflow1. Just like the build and the assemble workflow, add a
--distribution
parameter so that the signing workflow can use rpm toolkit to sign RPM packages2. Adding the rpm toolkit call for RPM package to OpenSearch Signer Client, as it is the backend for signing workflow to function correctly
3. A checksum will also be created after signing is completed to ensure the integrity of the package
%{name}-%{version}-%{release}.%{architecture}.rpm
so we have a clear path for upgrade/re-release (e.g.opensearch-1.2.0-1.x86_64.rpm
)yum-config-manager --add-repo
repository_url to do soyum install
command to install our RPM packagessystemctl
related commands to manage the servicerpm -ivh
command to manually install the package on hostsystemctl
related commands to manage the serviceyum upgrade
to upgrade to latest versionyum upgrade <package-version>
to upgrade to a specific versionyum downgrade
to downgrade to previous versionyum downgrade <package-version>
to downgrade to a specific versionrpm -Uvh
to upgrade manuallyrpm -Uvh —oldpackage
to downgrade manuallyImplementation
Overview (Outdated as of 2022/01/24. See above section for new requirements)
### OverviewWe are breaking the design into 2 parts,
Assemble Workflow
andPackaging
.build_workflow
to generate Min+Plugins Build Binary for OpenSearch/Dashboardsassemble_workflow
with our code changes, and passing--distribution deb/rpm
assemble_workflow
will callpackaging
with all the parameters defined in Usagepackaging
will callFPM
with all the parameters and generate packagesopensearch-build/dist
folder after creationPackaging with FPM
As of 2021/11, there are three tools that we can use to generate deb/rpm packages from Min+plugins build binaries. They are
gradle with ospackage
,Python Setuptools
, andFPM
. We choose to useFPM
as it is still the easiest, most documented, most used tool with the largest package output range support.Prerequisites
Please make sure that the version of
Ruby ~= 2.3.0
and theFPM
gem is installed.Usage
A long command for
FPM
is called in the assemble workflow including all the details such as service scripts, pre/post scripts, folder structure, architecture, type, and more for fine-grain setup of generating our projectDEB/RPM
packages.The inputs of
FPM
are:20220204 Update: We have switched from FPM to Rpmbuild for the final implementations, you can see the comments in this post for details: #1545
Assemble a RPM/DEB distribution
Currently, we have an existing assemble workflow implemented with Python. It takes the output from the build step, installs plugins, and assembles a full Distribution/Bundle into a
dist
folder.If you have not run the build_workflow yet, here is the command to generate MIN Tarball + Plugin Zips:
Once the build_workflow is completed, you can then run the assemble_workflow. A new argument
--distribution
is introduced to the assemble workflow, so that the distribution can be selected. For now, the input of--distribution
can berpm
,tar
orzip
. The default value istar
.You can then find the generated packages in
dist
folder ofopensearch-build
repo:Installation and Usages
Once you have the deb/rpm package, you can install and run the OpenSearch cluster on any Debian/RHEL flavored Linux Distro. Besides,
systemd
scripts are provided, so that process manager can directly manage the lifecycle of the cluster.To install deb/rpm:
To start service:
Once the cluster is up, you can then use the API to validate the state, and start to index your data:
https://opensearch.org/docs/latest/opensearch/popular-api/
Frequently Asked Questions
2. We will include runtime dependencies such as(Outdated as of 2022/01/24, see Requirements above for information related to adding these as dependencies)JAVA
andNODEJS
so user does not need to install them manually like in ODFE.apt install opensearch`` opensearch_dashboards
yum install opensearch opensearch_dashboards
dpkg -i opensearch-<VERSION>-linux-<ARCH>.deb opensearch-dashboards-<VERSION>-linux-<ARCH>.deb
rpm -ivh opensearch-<VERSION>-linux-<ARCH>.rpm opensearch-dashboards-<VERSION>-linux-<ARCH>.rpm
OpenSearch
Min code to generateDEB/RPM
?--distribution
when running the assemble_workflow--distribution
is an optional argument exposed toassemble.sh
.argparse
module helped us to define the argument and automatically generates help and usage messages and issues errors when users give the program invalid arguments. Thedefault
is the keyword we used to specify what value should be used when the--distributio
is not present. We setdefault="tar"
, which means that if--distributio
is not present, the workflow will assemble tarball.dist.py
file. For now, we use theos.getcwd()
to get the current root folder. You can change it to any other directory based on your requirement. The path will be passed into the packaging process.The text was updated successfully, but these errors were encountered: