Project

General

Profile

Actions

Feature #6752

closed

ceph-deploy to install yum or apt source with custom repo hostname

Added by Neil Levine over 10 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
other
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

The goal is to have a user grab an ISO or .tar.gz consisting of all the files they need to run Ceph which would be downloaded to the Admin Host.

These files would be unpacked and moved into a location with a Yum or APT directory structure that would be accessed via port 80, in effect turning the Admin Host into a Ceph repo mirror.

Ceph-deploy would then take a flag indicating the hostname that this repo is accessible from over the network. This would then be installed into the APT or YUM source file on the MON or OSD hosts that ceph-deploy will be installing Ceph on.

Bonus points: if the hostname of the Admin Host can be read from an environment variable on the Admin HOst, this will allow us to pre-define the name via an environment config file.

Actions #1

Updated by Alfredo Deza over 10 years ago

A convention needs to be followed to retrieve the correct GPG Key from the local repo. Currently, ceph-deploy uses this:

"https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/{key}.asc".format(key=key)

Where `key` is usually: `release`.

Actions #2

Updated by Alfredo Deza over 10 years ago

  • Status changed from 12 to In Progress
Actions #3

Updated by Neil Levine over 10 years ago

Yes, I suddenly thought about the keys too. Filename can also be an arg (--use-repo-key) ?

Actions #4

Updated by Alfredo Deza over 10 years ago

The key can be a regular file too, but then I would need to push that to nodes.

Also, it should be noted that for RPMs (have not checked DEBs yet) we use a package that creates `/etc/yum.repos.d/ceph.repo` for us with these contents:

[ceph]
name=Ceph packages for $basearch
baseurl=http://ceph.com/rpm-dumpling/el6/$basearch
enabled=1
gpgcheck=1
type=rpm-md
gpgkey=https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc

[ceph-noarch]
name=Ceph noarch packages
baseurl=http://ceph.com/rpm-dumpling/el6/noarch
enabled=1
gpgcheck=1
type=rpm-md
gpgkey=https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc

[ceph-source]
name=Ceph source packages
baseurl=http://ceph.com/rpm-dumpling/el6/SRPMS
enabled=0
gpgcheck=1
type=rpm-md
gpgkey=https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc

This means that we would need to create this without that helper package (currently: ceph-release-1-0.el6.noarch.rpm) with extra
care to be able to update/change this whenever the URL changes.

Actions #5

Updated by Alfredo Deza over 10 years ago

For DEBs we just write the correct URL to

/etc/apt/sources.list.d/ceph.list

So I would say that we need to implement a similar functionality for RPMs. I can get started with the same structure of that ceph.repo file for RPMs
in the meantime

Actions #6

Updated by Alfredo Deza over 10 years ago

A bunch of progress, we are now allowing a couple of flags: --repo-url and --gpg-url. When GPG is not passed in it will fallback to the public one (ideally you wouldn't do this, since it defeats the purpose).

Example output:

ceph-deploy install --repo-url http://example.org/rpms/ node2
[ceph_deploy.cli][INFO  ] Invoked (1.3.2): /Users/alfredo/.virtualenvs/ceph-deploy/bin/ceph-deploy install --repo-url http://example.org/rpms/ node2
[ceph_deploy.install][DEBUG ] Installing stable version emperor on cluster ceph hosts node2
[ceph_deploy.install][DEBUG ] Detecting platform for host node2 ...
[node2][DEBUG ] connected to host: node2
[node2][DEBUG ] detect platform information from remote host
[node2][DEBUG ] detect machine type
[ceph_deploy.install][INFO  ] Distro info: CentOS 6.4 Final
[node2][INFO  ] installing ceph on node2
[node2][INFO  ] using custom repository location: http://example.org/rpms/
[node2][WARNIN] --gpg-url was not used, will fallback
[node2][WARNIN] using GPG fallback: https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc
[node2][INFO  ] Running command: sudo yum -y -q install wget
[node2][ERROR ] http://example.org/rpms/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found" 
[node2][ERROR ] Trying other mirror.
[node2][ERROR ] http://example.org/rpms/noarch/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found" 
[node2][ERROR ] Trying other mirror.
[node2][DEBUG ] Package wget-1.12-1.8.el6.x86_64 already installed and latest version
[node2][INFO  ] Running command: sudo rpm --import https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc
[node2][DEBUG ] set the contents of /etc/yum.repos.d/ceph.repo
[node2][INFO  ] Running command: sudo yum -y -q install ceph
[node2][ERROR ] http://example.org/rpms/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found" 
[node2][ERROR ] Trying other mirror.
[node2][ERROR ] http://example.org/rpms/noarch/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found" 
[node2][ERROR ] Trying other mirror.
[node2][DEBUG ] Package ceph-0.67.4-0.el6.x86_64 already installed and latest version
[node2][INFO  ] Running command: sudo ceph --version
[node2][DEBUG ] ceph version 0.67.4 (ad85b8bfafea6232d64cb7ba76a8b6e8252fa0c7)

Note how it lets you know that you are in fact using a custom repo URL:

[node2][INFO  ] using custom repository location: http://example.org/rpms/
Actions #7

Updated by Alfredo Deza over 10 years ago

Now a fully working version with environment variables:

CEPH_DEPLOY_REPO_URL=http://192.168.1.131/rpm-emperor/el6/ CEPH_DEPLOY_GPG_URL=http://192.168.1.131/keys/release.asc ceph-deploy install node2
[ceph_deploy.cli][INFO  ] Invoked (1.3.2): /Users/alfredo/.virtualenvs/ceph-deploy/bin/ceph-deploy install node2
[ceph_deploy.install][DEBUG ] Installing stable version emperor on cluster ceph hosts node2
[ceph_deploy.install][DEBUG ] Detecting platform for host node2 ...
[node2][DEBUG ] connected to host: node2
[node2][DEBUG ] detect platform information from remote host
[node2][DEBUG ] detect machine type
[ceph_deploy.install][INFO  ] Distro info: CentOS 6.4 Final
[node2][INFO  ] installing ceph on node2
[node2][INFO  ] using custom repository location: http://192.168.1.131/rpm-emperor/el6/
[node2][INFO  ] Running command: sudo rpm --import http://192.168.1.131/keys/release.asc
[node2][DEBUG ] set the contents of /etc/yum.repos.d/ceph.repo
[node2][INFO  ] Running command: sudo yum -y -q install wget
[node2][DEBUG ] Package wget-1.12-1.8.el6.x86_64 already installed and latest version
[node2][INFO  ] Running command: sudo yum -y -q install ceph
[node2][INFO  ] Running command: sudo ceph --version
[node2][DEBUG ] ceph version 0.72.1 (4d923861868f6a15dcb33fef7f50f674997322de)
Actions #8

Updated by Alfredo Deza over 10 years ago

  • Status changed from In Progress to Fix Under Review
Actions #9

Updated by Alfredo Deza over 10 years ago

  • Status changed from Fix Under Review to Resolved

changeset was merged into ceph-deploy's master branch with hash: 3331b6f

A bunch of documentation was added as well and it is not live at ceph.com/ceph-deploy/docs/

Actions #10

Updated by Alfredo Deza over 10 years ago

  • Status changed from Resolved to In Progress

Found a couple of small items that needed to be fixed. Going to update in a different PR.

Actions #11

Updated by Alfredo Deza over 10 years ago

  • Status changed from In Progress to Fix Under Review
Actions #12

Updated by Alfredo Deza over 10 years ago

  • Status changed from Fix Under Review to Resolved

And that just got merged with hash: 9388f83

Actions

Also available in: Atom PDF