Skip to content

Commit 74c68ab

Browse files
salt: support Node.js and .NET zero config on linux (#4797)
1 parent 10043ac commit 74c68ab

20 files changed

+376
-43
lines changed

.github/workflows/salt-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ jobs:
5858
exit 1
5959
fi
6060
distro=$(for d in $dockerfiles; do echo -n "\"$d\","; done)
61-
arch="\"amd64\", \"arm64\""
62-
matrix="{\"DISTRO\": [${distro%,}]}"
61+
config="\"default\", \"custom\""
62+
matrix="{\"DISTRO\": [${distro%,}], \"CONFIG\": [${config}]}"
6363
echo "$matrix" | jq
6464
echo "matrix=${matrix}" >> $GITHUB_OUTPUT
6565
outputs:
@@ -97,7 +97,7 @@ jobs:
9797
# workaround for pytest substring matching
9898
distro="amazonlinux-2 and not amazonlinux-2023"
9999
fi
100-
python3 -u -m pytest -s --verbose -k "$distro" \
100+
python3 -u -m pytest -s --verbose -k "$distro and ${{ matrix.CONFIG }}" \
101101
internal/buildscripts/packaging/tests/deployments/salt/salt_test.py
102102
103103
# qemu, networking, running systemd in containers, etc., can be flaky
@@ -109,6 +109,6 @@ jobs:
109109
# workaround for pytest substring matching
110110
distro="amazonlinux-2 and not amazonlinux-2023"
111111
fi
112-
python3 -u -m pytest -s --verbose -k "$distro" \
112+
python3 -u -m pytest -s --verbose -k "$distro and ${{ matrix.CONFIG }}" \
113113
--last-failed \
114114
internal/buildscripts/packaging/tests/deployments/salt/salt_test.py

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
## Unreleased
44

5+
### 💡 Enhancements 💡
6+
7+
- (Splunk) [`splunk-otel-collector` Salt formula](https://github.com/signalfx/splunk-otel-collector/tree/main/deployments/salt): Initial support for
8+
Splunk OpenTelemetry [Node.js](https://github.com/signalfx/splunk-otel-js) and [.NET](https://github.com/signalfx/splunk-otel-dotnet) Auto Instrumentation on Linux
9+
- Both are activated by default if the `install_auto_instrumentation` option is set to `True`.
10+
- To skip Node.js auto instrumentation, configure the `auto_instrumentation_sdks` option without `nodejs`.
11+
- To skip .NET auto instrumentation, configure the `auto_instrumentation_sdks` option without `dotnet`.
12+
- `npm` is required to be pre-installed on the node to install the Node.js SDK. Configure the `auto_instrumentation_npm_path` option to specify the path to `npm`.
13+
- .NET auto instrumentation is currently only supported on amd64/x64_64.
14+
515
## v0.100.0
616

717
### 🛑 Breaking changes 🛑

deployments/salt/README.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,20 +140,35 @@ splunk-otel-collector:
140140

141141
### Auto Instrumentation (Linux Only)
142142

143-
**Note:** The Java application(s) on the node need to be started/restarted
144-
separately after installation/configuration in order for any changes to take
145-
effect.
143+
**Note:** The application(s) on the node need to be started/restarted separately
144+
after installation/configuration in order for any changes to take effect.
146145

147146
- `install_auto_instrumentation`: Whether to install/manage [Splunk
148-
OpenTelemetry Auto Instrumentation for Java](
147+
OpenTelemetry Auto Instrumentation](
149148
https://github.com/signalfx/splunk-otel-collector/tree/main/instrumentation).
150149
When set to `True`, the `splunk-otel-auto-instrumentation` deb/rpm package
151150
will be downloaded and installed from the Collector repository. (**default:**
152151
`False`)
153152

154153
- `auto_instrumentation_version`: Version of the
155154
`splunk-otel-auto-instrumentation` package to install, e.g. `0.50.0`. The
156-
minimum supported version is `0.48.0`. (**default:** `latest`)
155+
minimum supported version is `0.48.0`. The minimum supported version for
156+
Node.js auto instrumentation is `0.87.0`. The minimum supported version for
157+
.NET auto instrumentation is `0.99.0`. (**default:** `latest`)
158+
159+
- `auto_instrumentation_sdks`: List of Splunk OpenTelemetry Auto
160+
Instrumentation SDKs to install, configure, and activate. (**default:**
161+
`['java', 'nodejs', 'dotnet']`)
162+
163+
Currently, the following values are supported:
164+
- `java`: [Splunk OpenTelemetry for Java](https://github.com/signalfx/splunk-otel-java)
165+
- `nodejs`: [Splunk OpenTelemetry for Node.js](https://github.com/signalfx/splunk-otel-js)
166+
- `dotnet`: [Splunk OpenTelemetry for .NET](https://github.com/signalfx/splunk-otel-dotnet) (x86_64/amd64 only)
167+
168+
**Note:** This formula does not manage the installation/configuration of
169+
Node.js, `npm`, or Node.js applications. If `nodejs` is included in this
170+
option, Node.js and `npm` are required to be pre-installed on the node in
171+
order to install and activate the Node.js SDK.
157172

158173
- `auto_instrumentation_systemd`: By default, the `/etc/ld.so.preload` file on
159174
the node will be configured for the
@@ -180,6 +195,14 @@ effect.
180195
changed from the default value, the path should be an existing file on the
181196
node. (**default:** `/usr/lib/splunk-instrumentation/splunk-otel-javaagent.jar`)
182197

198+
- `auto_instrumentation_npm_path`: If the `auto_instrumentation_sdks` option
199+
includes `nodejs`, the Splunk OpenTelemetry for Node.js SDK will be installed
200+
with the `npm` command. Use this option to specify a custom path on the
201+
node for `npm`, for example `/my/custom/path/to/npm`. (**default:** `npm`)
202+
203+
**Note:** This role does not manage the installation/configuration of
204+
Node.js or `npm`.
205+
183206
- `auto_instrumentation_resource_attributes`: Configure the OpenTelemetry auto
184207
instrumentation resource attributes, e.g.
185208
`deployment.environment=prod,my.key=value` (comma-separated `key=value` pairs.).

deployments/salt/splunk-otel-collector/auto_instrumentation.sls

Lines changed: 124 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{% set auto_instrumentation_version = salt['pillar.get']('splunk-otel-collector:auto_instrumentation_version', 'latest') %}
22
{% set auto_instrumentation_systemd = salt['pillar.get']('splunk-otel-collector:auto_instrumentation_systemd', False) | to_bool %}
3+
{% set auto_instrumentation_sdks = salt['pillar.get']('splunk-otel-collector:auto_instrumentation_sdks', ['java', 'nodejs', 'dotnet']) %}
34
{% set auto_instrumentation_java_agent_path = salt['pillar.get']('splunk-otel-collector:auto_instrumentation_java_agent_path', '/usr/lib/splunk-instrumentation/splunk-otel-javaagent.jar') %}
5+
{% set auto_instrumentation_npm_path = salt['pillar.get']('splunk-otel-collector:auto_instrumentation_npm_path', 'npm') %}
46
{% set auto_instrumentation_ld_so_preload = salt['pillar.get']('splunk-otel-collector:auto_instrumentation_ld_so_preload') %}
57
{% set auto_instrumentation_resource_attributes = salt['pillar.get']('splunk-otel-collector:auto_instrumentation_resource_attributes') %}
68
{% set auto_instrumentation_service_name = salt['pillar.get']('splunk-otel-collector:auto_instrumentation_service_name') %}
@@ -10,6 +12,15 @@
1012
{% set auto_instrumentation_enable_profiler_memory = salt['pillar.get']('splunk-otel-collector:auto_instrumentation_enable_profiler_memory', False) | to_bool %}
1113
{% set auto_instrumentation_enable_metrics = salt['pillar.get']('splunk-otel-collector:auto_instrumentation_enable_metrics', False) | to_bool %}
1214
{% set auto_instrumentation_otlp_endpoint = salt['pillar.get']('splunk-otel-collector:auto_instrumentation_otlp_endpoint', 'http://127.0.0.1:4317') %}
15+
{% set with_new_instrumentation = auto_instrumentation_version == 'latest' or salt['pkg.version_cmp'](auto_instrumentation_version, '0.87.0') >= 0 %}
16+
{% set dotnet_supported = (auto_instrumentation_version == 'latest' or salt['pkg.version_cmp'](auto_instrumentation_version, '0.99.0') >= 0) and grains['cpuarch'] in ['amd64', 'x86_64'] %}
17+
{% set systemd_config_path = '/usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf' %}
18+
{% set old_instrumentation_config_path = '/usr/lib/splunk-instrumentation/instrumentation.conf' %}
19+
{% set java_config_path = '/etc/splunk/zeroconfig/java.conf' %}
20+
{% set nodejs_config_path = '/etc/splunk/zeroconfig/node.conf' %}
21+
{% set dotnet_config_path = '/etc/splunk/zeroconfig/dotnet.conf' %}
22+
{% set nodejs_prefix = '/usr/lib/splunk-instrumentation/splunk-otel-js' %}
23+
{% set dotnet_home = '/usr/lib/splunk-instrumentation/splunk-otel-dotnet' %}
1324

1425
Install Splunk OpenTelemetry Auto Instrumentation:
1526
pkg.installed:
@@ -18,6 +29,21 @@ Install Splunk OpenTelemetry Auto Instrumentation:
1829
- require:
1930
- pkg: splunk-otel-collector
2031

32+
{% if 'nodejs' in auto_instrumentation_sdks and with_new_instrumentation %}
33+
{{ nodejs_prefix }}/node_modules:
34+
file.directory:
35+
- makedirs: True
36+
- require:
37+
- pkg: splunk-otel-auto-instrumentation
38+
39+
Install splunk-otel-js:
40+
cmd.run:
41+
- name: {{ auto_instrumentation_npm_path}} install --global=false /usr/lib/splunk-instrumentation/splunk-otel-js.tgz
42+
- cwd: {{ nodejs_prefix }}
43+
- require:
44+
- file: {{ nodejs_prefix }}/node_modules
45+
{% endif %}
46+
2147
/etc/ld.so.preload:
2248
file.managed:
2349
- contents: |
@@ -32,11 +58,26 @@ Install Splunk OpenTelemetry Auto Instrumentation:
3258
- pkg: splunk-otel-auto-instrumentation
3359

3460
{% if auto_instrumentation_systemd %}
35-
/usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf:
61+
{{ systemd_config_path }}:
3662
file.managed:
3763
- contents:
3864
- "[Manager]"
65+
{% if 'java' in auto_instrumentation_sdks %}
3966
- DefaultEnvironment="JAVA_TOOL_OPTIONS=-javaagent:{{ auto_instrumentation_java_agent_path }}"
67+
{% endif %}
68+
{% if 'nodejs' in auto_instrumentation_sdks and with_new_instrumentation %}
69+
- DefaultEnvironment="NODE_OPTIONS=-r {{ nodejs_prefix }}/node_modules/@splunk/otel/instrument"
70+
{% endif %}
71+
{% if 'dotnet' in auto_instrumentation_sdks and dotnet_supported %}
72+
- DefaultEnvironment="CORECLR_ENABLE_PROFILING=1"
73+
- DefaultEnvironment="CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318}"
74+
- DefaultEnvironment="CORECLR_PROFILER_PATH={{ dotnet_home }}/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so"
75+
- DefaultEnvironment="DOTNET_ADDITIONAL_DEPS={{ dotnet_home }}/AdditionalDeps"
76+
- DefaultEnvironment="DOTNET_SHARED_STORE={{ dotnet_home }}/store"
77+
- DefaultEnvironment="DOTNET_STARTUP_HOOKS={{ dotnet_home }}/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll"
78+
- DefaultEnvironment="OTEL_DOTNET_AUTO_HOME={{ dotnet_home }}"
79+
- DefaultEnvironment="OTEL_DOTNET_AUTO_PLUGINS=Splunk.OpenTelemetry.AutoInstrumentation.Plugin,Splunk.OpenTelemetry.AutoInstrumentation"
80+
{% endif %}
4081
{% if auto_instrumentation_resource_attributes != "" %}
4182
- DefaultEnvironment="OTEL_RESOURCE_ATTRIBUTES=splunk.zc.method=splunk-otel-auto-instrumentation-{{ auto_instrumentation_version }}-systemd,{{ auto_instrumentation_resource_attributes }}"
4283
{% else %}
@@ -52,13 +93,22 @@ Install Splunk OpenTelemetry Auto Instrumentation:
5293
- makedirs: True
5394
- require:
5495
- pkg: splunk-otel-auto-instrumentation
96+
97+
{% for config in [java_config_path, nodejs_config_path, dotnet_config_path, old_instrumentation_config_path] %}
98+
Delete {{ config }}:
99+
file.absent:
100+
- name: {{ config }}
101+
- require:
102+
- pkg: splunk-otel-auto-instrumentation
103+
{% endfor %}
55104
{% else %}
56105
Delete auto instrumentation systemd config:
57106
file.absent:
58-
- name: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf
107+
- name: {{ systemd_config_path }}
59108
60-
{% if auto_instrumentation_version == 'latest' or salt['pkg.version_cmp'](auto_instrumentation_version, '0.87.0') >= 0 %}
61-
/etc/splunk/zeroconfig/java.conf:
109+
{% if with_new_instrumentation %}
110+
{% if 'java' in auto_instrumentation_sdks %}
111+
{{ java_config_path }}:
62112
file.managed:
63113
- contents:
64114
- JAVA_TOOL_OPTIONS=-javaagent:{{ auto_instrumentation_java_agent_path }}
@@ -78,7 +128,75 @@ Delete auto instrumentation systemd config:
78128
- require:
79129
- pkg: splunk-otel-auto-instrumentation
80130
{% else %}
81-
/usr/lib/splunk-instrumentation/instrumentation.conf:
131+
Delete {{ java_config_path }}:
132+
file.absent:
133+
- name:
134+
- require:
135+
- pkg: splunk-otel-auto-instrumentation
136+
{% endif %}
137+
{% if 'nodejs' in auto_instrumentation_sdks and with_new_instrumentation %}
138+
{{ nodejs_config_path }}:
139+
file.managed:
140+
- contents:
141+
- NODE_OPTIONS=-r {{ nodejs_prefix }}/node_modules/@splunk/otel/instrument
142+
{% if auto_instrumentation_resource_attributes != "" %}
143+
- OTEL_RESOURCE_ATTRIBUTES=splunk.zc.method=splunk-otel-auto-instrumentation-{{ auto_instrumentation_version }},{{ auto_instrumentation_resource_attributes }}
144+
{% else %}
145+
- OTEL_RESOURCE_ATTRIBUTES=splunk.zc.method=splunk-otel-auto-instrumentation-{{ auto_instrumentation_version }}
146+
{% endif %}
147+
{% if auto_instrumentation_service_name != "" %}
148+
- OTEL_SERVICE_NAME={{ auto_instrumentation_service_name }}
149+
{% endif %}
150+
- SPLUNK_PROFILER_ENABLED={{ auto_instrumentation_enable_profiler | string | lower }}
151+
- SPLUNK_PROFILER_MEMORY_ENABLED={{ auto_instrumentation_enable_profiler_memory | string | lower }}
152+
- SPLUNK_METRICS_ENABLED={{ auto_instrumentation_enable_metrics | string | lower }}
153+
- OTEL_EXPORTER_OTLP_ENDPOINT={{ auto_instrumentation_otlp_endpoint }}
154+
- makedirs: True
155+
- require:
156+
- pkg: splunk-otel-auto-instrumentation
157+
{% else %}
158+
Delete {{ nodejs_config_path }}:
159+
file.absent:
160+
- name: {{ nodejs_config_path }}
161+
- require:
162+
- pkg: splunk-otel-auto-instrumentation
163+
{% endif %}
164+
{% if 'dotnet' in auto_instrumentation_sdks and dotnet_supported %}
165+
{{ dotnet_config_path }}:
166+
file.managed:
167+
- contents:
168+
- CORECLR_ENABLE_PROFILING=1
169+
- CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318}
170+
- CORECLR_PROFILER_PATH={{ dotnet_home }}/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so
171+
- DOTNET_ADDITIONAL_DEPS={{ dotnet_home }}/AdditionalDeps
172+
- DOTNET_SHARED_STORE={{ dotnet_home }}/store
173+
- DOTNET_STARTUP_HOOKS={{ dotnet_home }}/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll
174+
- OTEL_DOTNET_AUTO_HOME={{ dotnet_home }}
175+
- OTEL_DOTNET_AUTO_PLUGINS=Splunk.OpenTelemetry.AutoInstrumentation.Plugin,Splunk.OpenTelemetry.AutoInstrumentation
176+
{% if auto_instrumentation_resource_attributes != "" %}
177+
- OTEL_RESOURCE_ATTRIBUTES=splunk.zc.method=splunk-otel-auto-instrumentation-{{ auto_instrumentation_version }},{{ auto_instrumentation_resource_attributes }}
178+
{% else %}
179+
- OTEL_RESOURCE_ATTRIBUTES=splunk.zc.method=splunk-otel-auto-instrumentation-{{ auto_instrumentation_version }}
180+
{% endif %}
181+
{% if auto_instrumentation_service_name != "" %}
182+
- OTEL_SERVICE_NAME={{ auto_instrumentation_service_name }}
183+
{% endif %}
184+
- SPLUNK_PROFILER_ENABLED={{ auto_instrumentation_enable_profiler | string | lower }}
185+
- SPLUNK_PROFILER_MEMORY_ENABLED={{ auto_instrumentation_enable_profiler_memory | string | lower }}
186+
- SPLUNK_METRICS_ENABLED={{ auto_instrumentation_enable_metrics | string | lower }}
187+
- OTEL_EXPORTER_OTLP_ENDPOINT={{ auto_instrumentation_otlp_endpoint }}
188+
- makedirs: True
189+
- require:
190+
- pkg: splunk-otel-auto-instrumentation
191+
{% else %}
192+
Delete {{ dotnet_config_path }}:
193+
file.absent:
194+
- name: {{ dotnet_config_path }}
195+
- require:
196+
- pkg: splunk-otel-auto-instrumentation
197+
{% endif %}
198+
{% else %}
199+
{{ old_instrumentation_config_path }}:
82200
file.managed:
83201
- contents:
84202
- java_agent_jar={{ auto_instrumentation_java_agent_path }}
@@ -105,4 +223,4 @@ Reload systemd:
105223
cmd.run:
106224
- name: systemctl daemon-reload
107225
- onchanges:
108-
- file: /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf
226+
- file: {{ systemd_config_path }}

internal/buildscripts/packaging/tests/deployments/salt/images/deb/Dockerfile.debian-bullseye

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ RUN echo 'deb https://repo.saltproject.io/py3/debian/11/amd64/latest/ bullseye m
1010
apt-get update && \
1111
apt-get install -y salt-minion
1212

13+
RUN wget -O /tmp/nodejs.tar.gz https://nodejs.org/dist/v16.20.2/node-v16.20.2-linux-x64.tar.gz && \
14+
mkdir -p /opt/ && \
15+
tar -C /opt/ -xzf /tmp/nodejs.tar.gz && \
16+
mv /opt/node* /opt/node
17+
18+
ENV PATH=/opt/node/bin:$PATH
1319
ENV container docker
1420

1521
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i = \

internal/buildscripts/packaging/tests/deployments/salt/images/deb/Dockerfile.debian-buster

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ RUN echo 'deb https://repo.saltproject.io/py3/debian/10/amd64/latest/ buster mai
1010
apt-get update && \
1111
apt-get install -y salt-minion
1212

13+
RUN wget -O /tmp/nodejs.tar.gz https://nodejs.org/dist/v16.20.2/node-v16.20.2-linux-x64.tar.gz && \
14+
mkdir -p /opt/ && \
15+
tar -C /opt/ -xzf /tmp/nodejs.tar.gz && \
16+
mv /opt/node* /opt/node
17+
18+
ENV PATH=/opt/node/bin:$PATH
19+
1320
ENV container docker
1421

1522
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i = \

internal/buildscripts/packaging/tests/deployments/salt/images/deb/Dockerfile.debian-stretch

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ RUN echo 'deb https://repo.saltproject.io/py3/debian/9/amd64/latest/ stretch mai
1313
apt-get update && \
1414
apt-get install -y salt-minion
1515

16+
RUN wget -O /tmp/nodejs.tar.gz https://nodejs.org/dist/v16.20.2/node-v16.20.2-linux-x64.tar.gz && \
17+
mkdir -p /opt/ && \
18+
tar -C /opt/ -xzf /tmp/nodejs.tar.gz && \
19+
mv /opt/node* /opt/node
20+
21+
ENV PATH=/opt/node/bin:$PATH
22+
1623
ENV container docker
1724

1825
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i = \

internal/buildscripts/packaging/tests/deployments/salt/images/deb/Dockerfile.ubuntu-bionic

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ RUN echo 'deb https://repo.saltproject.io/py3/ubuntu/18.04/amd64/latest bionic m
1010
apt-get update && \
1111
apt-get install -y salt-minion
1212

13+
RUN wget -O /tmp/nodejs.tar.gz https://nodejs.org/dist/v16.20.2/node-v16.20.2-linux-x64.tar.gz && \
14+
mkdir -p /opt/ && \
15+
tar -C /opt/ -xzf /tmp/nodejs.tar.gz && \
16+
mv /opt/node* /opt/node
17+
18+
ENV PATH=/opt/node/bin:$PATH
19+
1320
ENV container docker
1421

1522
RUN rm -f /lib/systemd/system/multi-user.target.wants/* \

internal/buildscripts/packaging/tests/deployments/salt/images/deb/Dockerfile.ubuntu-focal

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ RUN echo 'deb https://repo.saltproject.io/py3/ubuntu/20.04/amd64/latest focal ma
1010
apt-get update && \
1111
apt-get install -y salt-minion
1212

13+
RUN wget -O /tmp/nodejs.tar.gz https://nodejs.org/dist/v16.20.2/node-v16.20.2-linux-x64.tar.gz && \
14+
mkdir -p /opt/ && \
15+
tar -C /opt/ -xzf /tmp/nodejs.tar.gz && \
16+
mv /opt/node* /opt/node
17+
18+
ENV PATH=/opt/node/bin:$PATH
19+
1320
ENV container docker
1421

1522
RUN rm -f /lib/systemd/system/multi-user.target.wants/* \

internal/buildscripts/packaging/tests/deployments/salt/images/deb/Dockerfile.ubuntu-jammy

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ RUN apt-get install -y software-properties-common ca-certificates wget curl apt-
1212
# apt-get install -y salt-minion
1313
RUN pip install 'Jinja2<3.1' salt
1414

15+
RUN wget -O /tmp/nodejs.tar.gz https://nodejs.org/dist/v16.20.2/node-v16.20.2-linux-x64.tar.gz && \
16+
mkdir -p /opt/ && \
17+
tar -C /opt/ -xzf /tmp/nodejs.tar.gz && \
18+
mv /opt/node* /opt/node
19+
20+
ENV PATH=/opt/node/bin:$PATH
21+
1522
ENV container docker
1623

1724
RUN rm -f /lib/systemd/system/multi-user.target.wants/* \

internal/buildscripts/packaging/tests/deployments/salt/images/rpm/Dockerfile.amazonlinux-2

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@ FROM amazonlinux:2
22

33
ENV container docker
44

5-
RUN yum install -y systemd procps initscripts python3-pip python3-devel gcc
5+
RUN yum install -y systemd procps initscripts python3-pip python3-devel gcc wget tar
66

77
RUN rpm --import https://repo.saltproject.io/py3/amazon/2/x86_64/latest/SALTSTACK-GPG-KEY.pub
88
RUN curl -fsSL https://repo.saltproject.io/py3/amazon/2/x86_64/latest.repo | tee /etc/yum.repos.d/salt-amzn.repo
99

1010
RUN yum install -y salt-minion
1111

12+
RUN wget -O /tmp/nodejs.tar.gz https://nodejs.org/dist/v16.20.2/node-v16.20.2-linux-x64.tar.gz && \
13+
mkdir -p /opt/ && \
14+
tar -C /opt/ -xzf /tmp/nodejs.tar.gz && \
15+
mv /opt/node* /opt/node
16+
17+
ENV PATH=/opt/node/bin:$PATH
18+
1219
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i = \
1320
"systemd-tmpfiles-setup.service" ] || rm -f $i; done); \
1421
rm -f /lib/systemd/system/multi-user.target.wants/*;\

0 commit comments

Comments
 (0)