Skip to content

Commit 6314bc4

Browse files
rkavitha-hclBibhuprasad Singh
authored and
Bibhuprasad Singh
committed
gNOI Cold Reboot - Adding the framework docker in the sonic-buildimage
1 parent a1e2c1f commit 6314bc4

File tree

3 files changed

+82
-0
lines changed

3 files changed

+82
-0
lines changed
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
2+
FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
3+
4+
ARG docker_container_name
5+
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf
6+
7+
## Make apt-get non-interactive
8+
ENV DEBIAN_FRONTEND=noninteractive
9+
10+
RUN apt-get update && \
11+
apt-get install -f -y \
12+
libdbus-1-3 \
13+
libdbus-c++-1-0v5
14+
15+
{% if docker_framework_debs.strip() -%}
16+
# Copy locally-built Debian package dependencies
17+
{{ copy_files("debs/", docker_framework_debs.split(' '), "/debs/") }}
18+
19+
# Install locally-built Debian packages and implicitly install their dependencies
20+
{{ install_debian_packages(docker_framework_debs.split(' ')) }}
21+
{%- endif %}
22+
23+
RUN apt-get clean -y && \
24+
apt-get autoclean - && \
25+
apt-get autoremove -y && \
26+
rm -rf /debs /var/lib/apt/lists/* /tmp/* ~/.cache/
27+
28+
# creating sonic conig_status file.
29+
RUN mkdir -p /var/sonic
30+
RUN echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status
31+
32+
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
33+
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
34+
35+
ENTRYPOINT ["/usr/local/bin/supervisord"]

dockers/docker-framework/framework.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
4+
exec /usr/local/bin/framework --logtostderr
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
[supervisord]
2+
logfile_maxbytes=1MB
3+
logfile_backups=2
4+
loglevel=warn
5+
nodaemon=true
6+
7+
[eventlistener:dependent-startup]
8+
command=python3 -m supervisord_dependent_startup --log-level warn
9+
autostart=true
10+
autorestart=unexpected
11+
stdout_logfile=syslog
12+
stderr_logfile=syslog
13+
startretries=0
14+
exitcodes=0,3
15+
events=PROCESS_STATE
16+
buffer_size=50
17+
18+
[eventlistener:supervisor-proc-exit-listener]
19+
command=/usr/bin/supervisor-proc-exit-listener --container-name framework
20+
events=PROCESS_STATE_EXITED
21+
autostart=true
22+
autorestart=unexpected
23+
stdout_logfile=syslog
24+
stderr_logfile=syslog
25+
26+
[program:rsyslogd]
27+
command=/usr/sbin/rsyslogd -n -iNONE
28+
priority=1
29+
autostart=false
30+
autorestart=unexpected
31+
stdout_logfile=syslog
32+
stderr_logfile=syslog
33+
dependent_startup=true
34+
35+
[program:rebootbackend]
36+
command=/usr/bin/rebootbackend
37+
priority=2
38+
autostart=false
39+
autorestart=true
40+
stdout_logfile=syslog
41+
stderr_logfile=syslog
42+
dependent_startup=true
43+
dependent_startup_wait_for=start:exited

0 commit comments

Comments
 (0)