Skip to content

Commit 52f425a

Browse files
Revert "Use ros-apt-source package"
This reverts commit 3add115. Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
1 parent 3add115 commit 52f425a

File tree

4 files changed

+169
-103
lines changed

4 files changed

+169
-103
lines changed

dist/index.js

Lines changed: 84 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6965,23 +6965,13 @@ function addDnfRepo(use_ros2_testing) {
69656965
"--set-enabled",
69666966
extra_repo_name,
69676967
]);
6968-
// Install key and repo using ros-apt-source:
6969-
// https://docs.ros.org/en/rolling/Installation/RHEL-Install-RPMs.html#enable-required-repositories
6970-
const apt_version = yield utils.getRosAptSourceLatestVersion();
6968+
const testing_repo_suffix = use_ros2_testing ? "-testing" : "";
69716969
yield utils.exec("sudo", [
6972-
"dnf",
6973-
"install",
6974-
`https://github.com/${utils.ROS_APT_SOURCE_REPO}/releases/download/${apt_version}/ros2-release-${apt_version}-1.noarch.rpm`,
6970+
"curl",
6971+
"--output",
6972+
"/etc/yum.repos.d/ros2.repo",
6973+
`http://packages.ros.org/ros2${testing_repo_suffix}/rhel/ros2${testing_repo_suffix}.repo`,
69756974
]);
6976-
if (use_ros2_testing) {
6977-
yield utils.exec("sudo", ["dnf", "config-manager", "--disable", "ros2"]);
6978-
yield utils.exec("sudo", [
6979-
"dnf",
6980-
"config-manager",
6981-
"--enable",
6982-
"ros2-testing",
6983-
]);
6984-
}
69856975
yield utils.exec("sudo", ["dnf", "makecache", "--assumeyes"]);
69866976
});
69876977
}
@@ -7069,13 +7059,68 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
70697059
step((generator = generator.apply(thisArg, _arguments || [])).next());
70707060
});
70717061
};
7062+
var __importDefault = (this && this.__importDefault) || function (mod) {
7063+
return (mod && mod.__esModule) ? mod : { "default": mod };
7064+
};
70727065
Object.defineProperty(exports, "__esModule", ({ value: true }));
70737066
exports.runLinux = runLinux;
70747067
const core = __importStar(__nccwpck_require__(186));
70757068
const io = __importStar(__nccwpck_require__(436));
70767069
const apt = __importStar(__nccwpck_require__(671));
70777070
const pip = __importStar(__nccwpck_require__(744));
70787071
const utils = __importStar(__nccwpck_require__(314));
7072+
const path = __importStar(__nccwpck_require__(17));
7073+
const fs_1 = __importDefault(__nccwpck_require__(147));
7074+
// Open Robotics APT Repository public GPG key, as retrieved at:
7075+
// https://github.com/ros/rosdistro/blob/master/ros.asc
7076+
//
7077+
// Unfortunately, usin apt-key adv is slow, and is failing sometimes, causing
7078+
// spurious pipelines failures. The action is hard-coding the key here to
7079+
// mitigate this issue.
7080+
const openRoboticsAptPublicGpgKey = `
7081+
-----BEGIN PGP PUBLIC KEY BLOCK-----
7082+
Version: GnuPG v1
7083+
7084+
mQINBFzvJpYBEADY8l1YvO7iYW5gUESyzsTGnMvVUmlV3XarBaJz9bGRmgPXh7jc
7085+
VFrQhE0L/HV7LOfoLI9H2GWYyHBqN5ERBlcA8XxG3ZvX7t9nAZPQT2Xxe3GT3tro
7086+
u5oCR+SyHN9xPnUwDuqUSvJ2eqMYb9B/Hph3OmtjG30jSNq9kOF5bBTk1hOTGPH4
7087+
K/AY0jzT6OpHfXU6ytlFsI47ZKsnTUhipGsKucQ1CXlyirndZ3V3k70YaooZ55rG
7088+
aIoAWlx2H0J7sAHmqS29N9jV9mo135d+d+TdLBXI0PXtiHzE9IPaX+ctdSUrPnp+
7089+
TwR99lxglpIG6hLuvOMAaxiqFBB/Jf3XJ8OBakfS6nHrWH2WqQxRbiITl0irkQoz
7090+
pwNEF2Bv0+Jvs1UFEdVGz5a8xexQHst/RmKrtHLct3iOCvBNqoAQRbvWvBhPjO/p
7091+
V5cYeUljZ5wpHyFkaEViClaVWqa6PIsyLqmyjsruPCWlURLsQoQxABcL8bwxX7UT
7092+
hM6CtH6tGlYZ85RIzRifIm2oudzV5l+8oRgFr9yVcwyOFT6JCioqkwldW52P1pk/
7093+
/SnuexC6LYqqDuHUs5NnokzzpfS6QaWfTY5P5tz4KHJfsjDIktly3mKVfY0f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+6sXxlQFAmgSGgYFCRS0dnAACgkQ9C7W+6sX
7110+
xlS/UA//aAgP67DunDdak96+fLemWJkl4PHhj6637lzacJ+SlRzeUbnS/2XLhmk1
7111+
BNYoib3IHp3GBqvLsQqkCUZWaJTvkkAvJ+1W2N7JByt7Z/tnTS7aVfDxF53nYCxY
7112+
eSH921y2AtIZCIl1N3R2ic7pyzNkVVqwKIV1EqWLMa8GQTy4V0pgwaLE6Ce9Bmtv
7113+
04upGyiPXRoPM3Rfc0mTUtPGJLf651img6TYGb1UbKs2aAitiI2ptg8EdiRYYcGo
7114+
nG8Ar3aUnYj+fpfhTyvqwx0MTtAPDiMUx2vELReYIvhwU+SRHWpp20nL0WIK2krK
7115+
qIq5SwIboBSLkQ5j7tjehKkqfxanUrlUxu/XYlEhq0Mh5oCfBrarIFBUBULUX86p
7116+
ZQUqW4+MrIxHcNcrCPGm3U/4dSZ1rTAdyeEUi7a2H96CYYofl7dq1xXGMDFh+b5/
7117+
3Yw3t8US4VCwxmEj+C3ciARJauB1oDOilEieszPvIS3PdVpp6HCZRRHaB689AzMF
7118+
FoD40iowsNS9XmO6O8V7xzVVS0EtNhz9qUGIz8yjWeLLdpR8NqHOFOvrPP66voEV
7119+
Gc0Va/nozc05WWt42bc0hs1faRMqHRlAlJIKSUm4NSqc+YDNPYFlZSnB97tBhHC9
7120+
CEXRgHY3Utq/I3CLJ+KcJCUCH5D16Z7aOoazG9DKbewA+da8Drw=
7121+
=9IZg
7122+
-----END PGP PUBLIC KEY BLOCK-----
7123+
`;
70797124
/**
70807125
* Configure basic OS stuff.
70817126
*/
@@ -7115,36 +7160,43 @@ function configOs() {
71157160
yield apt.runAptGetInstall(["tzdata"]);
71167161
});
71177162
}
7163+
/**
7164+
* Add OSRF APT repository key.
7165+
*
7166+
* This is necessary even when building from source to install colcon, vcs, etc.
7167+
*/
7168+
function addAptRepoKey() {
7169+
return __awaiter(this, void 0, void 0, function* () {
7170+
const workspace = process.env.GITHUB_WORKSPACE;
7171+
const keyFilePath = path.join(workspace, "ros.key");
7172+
fs_1.default.writeFileSync(keyFilePath, openRoboticsAptPublicGpgKey);
7173+
yield utils.exec("sudo", ["apt-key", "add", keyFilePath]);
7174+
});
7175+
}
71187176
// Ubuntu distribution for ROS 1
71197177
const ros1UbuntuVersion = "focal";
71207178
/**
71217179
* Add OSRF APT repository.
71227180
*
71237181
* @param ubuntuCodename the Ubuntu version codename
7124-
* @param use_ros2_testing whether to use the apt testing repository
71257182
*/
71267183
function addAptRepo(ubuntuCodename, use_ros2_testing) {
71277184
return __awaiter(this, void 0, void 0, function* () {
7128-
// Install key and apt repo using ros-apt-source:
7129-
// https://docs.ros.org/en/rolling/Installation/Ubuntu-Install-Debs.html#enable-required-repositories
7130-
const apt_version = yield utils.getRosAptSourceLatestVersion();
7131-
const deb_file = "/tmp/apt-source.deb";
7132-
let deb_url = "";
71337185
// There is now no Ubuntu version overlap between ROS 1 and ROS 2
71347186
if (ros1UbuntuVersion === ubuntuCodename) {
7135-
deb_url = `https://github.com/${utils.ROS_APT_SOURCE_REPO}/releases/download/${apt_version}/ros-apt-source_${apt_version}.${ubuntuCodename}_all.deb`;
7187+
yield utils.exec("sudo", [
7188+
"bash",
7189+
"-c",
7190+
`echo "deb http://packages.ros.org/ros/ubuntu ${ubuntuCodename} main" > /etc/apt/sources.list.d/ros-latest.list`,
7191+
]);
71367192
}
71377193
else {
7138-
const testing = use_ros2_testing ? "-testing" : "";
7139-
deb_url = `https://github.com/${utils.ROS_APT_SOURCE_REPO}/releases/download/${apt_version}/ros2${testing}-apt-source_${apt_version}.${ubuntuCodename}_all.deb`;
7194+
yield utils.exec("sudo", [
7195+
"bash",
7196+
"-c",
7197+
`echo "deb http://packages.ros.org/ros2${use_ros2_testing ? "-testing" : ""}/ubuntu ${ubuntuCodename} main" > /etc/apt/sources.list.d/ros2-latest.list`,
7198+
]);
71407199
}
7141-
yield utils.exec("sudo", [
7142-
"bash",
7143-
"-c",
7144-
`curl -L -o ${deb_file} "${deb_url}"`,
7145-
]);
7146-
yield utils.exec("sudo", ["bash", "-c", `apt install ${deb_file}`]);
7147-
yield utils.exec("sudo", ["bash", "-c", `rm ${deb_file}`]);
71487200
yield utils.exec("sudo", ["apt-get", "update"]);
71497201
});
71507202
}
@@ -7174,6 +7226,7 @@ function runLinux() {
71747226
const use_ros2_testing = core.getInput("use-ros2-testing") === "true";
71757227
const installConnext = core.getInput("install-connext") === "true";
71767228
yield configOs();
7229+
yield addAptRepoKey();
71777230
const ubuntuCodename = yield utils.determineDistribCodename();
71787231
yield addAptRepo(ubuntuCodename, use_ros2_testing);
71797232
if ("noble" !== ubuntuCodename) {
@@ -7477,15 +7530,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
74777530
});
74787531
};
74797532
Object.defineProperty(exports, "__esModule", ({ value: true }));
7480-
exports.ROS_APT_SOURCE_REPO = void 0;
74817533
exports.exec = exec;
74827534
exports.getRequiredRosDistributions = getRequiredRosDistributions;
74837535
exports.validateDistro = validateDistro;
74847536
exports.determineDistribCodename = determineDistribCodename;
74857537
exports.determineDistrib = determineDistrib;
74867538
exports.determineDistribVer = determineDistribVer;
74877539
exports.getArch = getArch;
7488-
exports.getRosAptSourceLatestVersion = getRosAptSourceLatestVersion;
74897540
const actions_exec = __importStar(__nccwpck_require__(514));
74907541
const core = __importStar(__nccwpck_require__(186));
74917542
/**
@@ -7597,25 +7648,6 @@ function getArch() {
75977648
return getCommandOutput("dpkg --print-architecture");
75987649
});
75997650
}
7600-
exports.ROS_APT_SOURCE_REPO = "ros-infrastructure/ros-apt-source";
7601-
/**
7602-
* Get the latest version of the ros-apt-source package.
7603-
*
7604-
* https://github.com/ros-infrastructure/ros-apt-source/releases
7605-
*
7606-
* @returns the latest version of the ros-apt-source packages
7607-
*/
7608-
function getRosAptSourceLatestVersion() {
7609-
return __awaiter(this, void 0, void 0, function* () {
7610-
// TODO(christophebedard): figure out why doesn't work and switch back
7611-
// return getCommandOutput(
7612-
// `curl -s https://api.github.com/repos/${ROS_APT_SOURCE_REPO}/releases/latest | grep -F "tag_name" | awk -F\\" '{print $4}'`,
7613-
// );
7614-
return new Promise((resolve) => {
7615-
resolve("1.1.0");
7616-
});
7617-
});
7618-
}
76197651

76207652

76217653
/***/ }),

src/setup-ros-rhel.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,13 @@ async function addDnfRepo(use_ros2_testing: boolean): Promise<void> {
7272
extra_repo_name,
7373
]);
7474

75-
// Install key and repo using ros-apt-source:
76-
// https://docs.ros.org/en/rolling/Installation/RHEL-Install-RPMs.html#enable-required-repositories
77-
const apt_version = await utils.getRosAptSourceLatestVersion();
75+
const testing_repo_suffix = use_ros2_testing ? "-testing" : "";
7876
await utils.exec("sudo", [
79-
"dnf",
80-
"install",
81-
`https://github.com/${utils.ROS_APT_SOURCE_REPO}/releases/download/${apt_version}/ros2-release-${apt_version}-1.noarch.rpm`,
77+
"curl",
78+
"--output",
79+
"/etc/yum.repos.d/ros2.repo",
80+
`http://packages.ros.org/ros2${testing_repo_suffix}/rhel/ros2${testing_repo_suffix}.repo`,
8281
]);
83-
if (use_ros2_testing) {
84-
await utils.exec("sudo", ["dnf", "config-manager", "--disable", "ros2"]);
85-
await utils.exec("sudo", [
86-
"dnf",
87-
"config-manager",
88-
"--enable",
89-
"ros2-testing",
90-
]);
91-
}
9282

9383
await utils.exec("sudo", ["dnf", "makecache", "--assumeyes"]);
9484
}

src/setup-ros-ubuntu.ts

Lines changed: 80 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,60 @@ import * as apt from "./package_manager/apt";
55
import * as pip from "./package_manager/pip";
66
import * as utils from "./utils";
77

8+
import * as path from "path";
9+
import fs from "fs";
10+
11+
// Open Robotics APT Repository public GPG key, as retrieved at:
12+
// https://github.com/ros/rosdistro/blob/master/ros.asc
13+
//
14+
// Unfortunately, usin apt-key adv is slow, and is failing sometimes, causing
15+
// spurious pipelines failures. The action is hard-coding the key here to
16+
// mitigate this issue.
17+
const openRoboticsAptPublicGpgKey = `
18+
-----BEGIN PGP PUBLIC KEY BLOCK-----
19+
Version: GnuPG v1
20+
21+
mQINBFzvJpYBEADY8l1YvO7iYW5gUESyzsTGnMvVUmlV3XarBaJz9bGRmgPXh7jc
22+
VFrQhE0L/HV7LOfoLI9H2GWYyHBqN5ERBlcA8XxG3ZvX7t9nAZPQT2Xxe3GT3tro
23+
u5oCR+SyHN9xPnUwDuqUSvJ2eqMYb9B/Hph3OmtjG30jSNq9kOF5bBTk1hOTGPH4
24+
K/AY0jzT6OpHfXU6ytlFsI47ZKsnTUhipGsKucQ1CXlyirndZ3V3k70YaooZ55rG
25+
aIoAWlx2H0J7sAHmqS29N9jV9mo135d+d+TdLBXI0PXtiHzE9IPaX+ctdSUrPnp+
26+
TwR99lxglpIG6hLuvOMAaxiqFBB/Jf3XJ8OBakfS6nHrWH2WqQxRbiITl0irkQoz
27+
pwNEF2Bv0+Jvs1UFEdVGz5a8xexQHst/RmKrtHLct3iOCvBNqoAQRbvWvBhPjO/p
28+
V5cYeUljZ5wpHyFkaEViClaVWqa6PIsyLqmyjsruPCWlURLsQoQxABcL8bwxX7UT
29+
hM6CtH6tGlYZ85RIzRifIm2oudzV5l+8oRgFr9yVcwyOFT6JCioqkwldW52P1pk/
30+
/SnuexC6LYqqDuHUs5NnokzzpfS6QaWfTY5P5tz4KHJfsjDIktly3mKVfY0fSPVV
31+
okdGpcUzvz2hq1fqjxB6MlB/1vtk0bImfcsoxBmF7H+4E9ZN1sX/tSb0KQARAQAB
32+
tCZPcGVuIFJvYm90aWNzIDxpbmZvQG9zcmZvdW5kYXRpb24ub3JnPokCVAQTAQgA
33+
PgIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBMHPbjHmut6IaLFytPQu1vur
34+
F8ZUBQJgsdhRBQkLTMW7AAoJEPQu1vurF8ZUTMwP/3f7EkOPIFjUdRmpNJ2db4iB
35+
RQu5b2SJRG+KIdbvQBz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nYj+fpfhTyvqwx0MTtAPDiMUx2vELReYIvhwU+SRHWpp20nL0WIK2krK
52+
qIq5SwIboBSLkQ5j7tjehKkqfxanUrlUxu/XYlEhq0Mh5oCfBrarIFBUBULUX86p
53+
ZQUqW4+MrIxHcNcrCPGm3U/4dSZ1rTAdyeEUi7a2H96CYYofl7dq1xXGMDFh+b5/
54+
3Yw3t8US4VCwxmEj+C3ciARJauB1oDOilEieszPvIS3PdVpp6HCZRRHaB689AzMF
55+
FoD40iowsNS9XmO6O8V7xzVVS0EtNhz9qUGIz8yjWeLLdpR8NqHOFOvrPP66voEV
56+
Gc0Va/nozc05WWt42bc0hs1faRMqHRlAlJIKSUm4NSqc+YDNPYFlZSnB97tBhHC9
57+
CEXRgHY3Utq/I3CLJ+KcJCUCH5D16Z7aOoazG9DKbewA+da8Drw=
58+
=9IZg
59+
-----END PGP PUBLIC KEY BLOCK-----
60+
`;
61+
862
/**
963
* Configure basic OS stuff.
1064
*/
@@ -46,40 +100,47 @@ async function configOs(): Promise<void> {
46100
await apt.runAptGetInstall(["tzdata"]);
47101
}
48102

103+
/**
104+
* Add OSRF APT repository key.
105+
*
106+
* This is necessary even when building from source to install colcon, vcs, etc.
107+
*/
108+
async function addAptRepoKey(): Promise<void> {
109+
const workspace = process.env.GITHUB_WORKSPACE as string;
110+
const keyFilePath = path.join(workspace, "ros.key");
111+
fs.writeFileSync(keyFilePath, openRoboticsAptPublicGpgKey);
112+
await utils.exec("sudo", ["apt-key", "add", keyFilePath]);
113+
}
114+
49115
// Ubuntu distribution for ROS 1
50116
const ros1UbuntuVersion = "focal";
51117

52118
/**
53119
* Add OSRF APT repository.
54120
*
55121
* @param ubuntuCodename the Ubuntu version codename
56-
* @param use_ros2_testing whether to use the apt testing repository
57122
*/
58123
async function addAptRepo(
59124
ubuntuCodename: string,
60125
use_ros2_testing: boolean,
61126
): Promise<void> {
62-
// Install key and apt repo using ros-apt-source:
63-
// https://docs.ros.org/en/rolling/Installation/Ubuntu-Install-Debs.html#enable-required-repositories
64-
const apt_version = await utils.getRosAptSourceLatestVersion();
65-
const deb_file = "/tmp/apt-source.deb";
66-
67-
let deb_url = "";
68127
// There is now no Ubuntu version overlap between ROS 1 and ROS 2
69128
if (ros1UbuntuVersion === ubuntuCodename) {
70-
deb_url = `https://github.com/${utils.ROS_APT_SOURCE_REPO}/releases/download/${apt_version}/ros-apt-source_${apt_version}.${ubuntuCodename}_all.deb`;
129+
await utils.exec("sudo", [
130+
"bash",
131+
"-c",
132+
`echo "deb http://packages.ros.org/ros/ubuntu ${ubuntuCodename} main" > /etc/apt/sources.list.d/ros-latest.list`,
133+
]);
71134
} else {
72-
const testing = use_ros2_testing ? "-testing" : "";
73-
deb_url = `https://github.com/${utils.ROS_APT_SOURCE_REPO}/releases/download/${apt_version}/ros2${testing}-apt-source_${apt_version}.${ubuntuCodename}_all.deb`;
135+
await utils.exec("sudo", [
136+
"bash",
137+
"-c",
138+
`echo "deb http://packages.ros.org/ros2${
139+
use_ros2_testing ? "-testing" : ""
140+
}/ubuntu ${ubuntuCodename} main" > /etc/apt/sources.list.d/ros2-latest.list`,
141+
]);
74142
}
75143

76-
await utils.exec("sudo", [
77-
"bash",
78-
"-c",
79-
`curl -L -o ${deb_file} "${deb_url}"`,
80-
]);
81-
await utils.exec("sudo", ["bash", "-c", `apt install ${deb_file}`]);
82-
await utils.exec("sudo", ["bash", "-c", `rm ${deb_file}`]);
83144
await utils.exec("sudo", ["apt-get", "update"]);
84145
}
85146

@@ -109,6 +170,8 @@ export async function runLinux(): Promise<void> {
109170

110171
await configOs();
111172

173+
await addAptRepoKey();
174+
112175
const ubuntuCodename = await utils.determineDistribCodename();
113176
await addAptRepo(ubuntuCodename, use_ros2_testing);
114177

src/utils.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -121,22 +121,3 @@ export async function determineDistribVer(): Promise<string> {
121121
export async function getArch(): Promise<string> {
122122
return getCommandOutput("dpkg --print-architecture");
123123
}
124-
125-
export const ROS_APT_SOURCE_REPO = "ros-infrastructure/ros-apt-source";
126-
127-
/**
128-
* Get the latest version of the ros-apt-source package.
129-
*
130-
* https://github.com/ros-infrastructure/ros-apt-source/releases
131-
*
132-
* @returns the latest version of the ros-apt-source packages
133-
*/
134-
export async function getRosAptSourceLatestVersion(): Promise<string> {
135-
// TODO(christophebedard): figure out why doesn't work and switch back
136-
// return getCommandOutput(
137-
// `curl -s https://api.github.com/repos/${ROS_APT_SOURCE_REPO}/releases/latest | grep -F "tag_name" | awk -F\\" '{print $4}'`,
138-
// );
139-
return new Promise((resolve) => {
140-
resolve("1.1.0");
141-
});
142-
}

0 commit comments

Comments
 (0)