Skip to content

Commit 495aa25

Browse files
rkavitha-hclBibhuprasad Singh
authored and
Bibhuprasad Singh
committed
GNOI Cold Reboot
1 parent 9588a40 commit 495aa25

File tree

4 files changed

+97
-0
lines changed

4 files changed

+97
-0
lines changed
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
2+
FROM docker-config-engine-bullseye-{{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+
COPY ["start.sh", "/usr/bin/"]
29+
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
30+
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
31+
# COPY ["git_commits", "/usr"]
32+
33+
34+
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

dockers/docker-framework/start.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
4+
mkdir -p /var/sonic
5+
echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status
+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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:start]
36+
command=/usr/bin/start.sh
37+
priority=2
38+
autostart=false
39+
autorestart=false
40+
startsecs=0
41+
stdout_logfile=syslog
42+
stderr_logfile=syslog
43+
dependent_startup=true
44+
dependent_startup_wait_for=rsyslogd:running
45+
46+
[program:rebootbackend]
47+
command=/usr/bin/rebootbackend
48+
priority=3
49+
autostart=false
50+
autorestart=true
51+
stdout_logfile=syslog
52+
stderr_logfile=syslog
53+
dependent_startup=true
54+
dependent_startup_wait_for=start:exited

0 commit comments

Comments
 (0)