Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "[docker-mgmt-framework]: update mgmt framework docker to support sonic-cli cmd" #7880

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions dockers/docker-sonic-mgmt-framework/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,21 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get install -y g++ python3-dev libxml2 libcurl3-gnutls libcjson-dev
apt-get install -y g++ python3-dev libxml2

# TODO: Remove these lines once we no longer need Python 2
RUN apt-get install -f -y python-dev python-pip
RUN pip2 install --upgrade 'pip<21'
RUN apt-get purge -y python-pip
RUN pip2 install setuptools==40.8.0
RUN pip2 install wheel==0.35.1
RUN pip2 install connexion==1.1.15 \
setuptools==21.0.0 \
grpcio-tools==1.20.0 \
certifi==2017.4.17 \
python-dateutil==2.6.0 \
six==1.11.0 \
urllib3==1.21.1

RUN pip3 install connexion==2.7.0 \
setuptools==21.0.0 \
Expand All @@ -32,12 +46,11 @@ COPY ["start.sh", "rest-server.sh", "/usr/bin/"]
COPY ["mgmt_vars.j2", "/usr/share/sonic/templates/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]

# TODO: Remove this line once we no longer need Python 2
RUN apt-get purge -y python-dev

RUN apt-get remove -y g++ python3-dev
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /debs

## TODO: symbolic links will be removed when AAA improvements get merged
RUN ln -sf /host_etc/passwd /etc/passwd
RUN ln -sf /host_etc/group /etc/group

ENTRYPOINT ["/usr/local/bin/supervisord"]
21 changes: 2 additions & 19 deletions dockers/docker-sonic-mgmt-framework/base_image_files/sonic-cli
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
#!/bin/bash

# Disallow CLI for the root user, since we don't have auth certs for root
if [[ "$(id -u)" == 0 ]]
then
echo "FATAL: root cannot launch CLI" >&2
exit 1
fi
TIMEOUT=605
if [[ "$1" =~ "prompt=" ]]
then
SYSTEM_NAME=`echo $1 | cut -d"=" -f2`
shift
docker exec -e SYSTEM_NAME=$SYSTEM_NAME -e CLI_USER="$USER" -u $(id -u):$(id -g) -it mgmt-framework /usr/sbin/cli/clish_start -t "$TIMEOUT" "$@"
else
docker exec -e CLI_USER="$USER" -e SYSTEM_NAME=$HOSTNAME -u $(id -u):$(id -g) -it mgmt-framework /usr/sbin/cli/clish_start -t "$TIMEOUT" "$@"
fi
ret=$?
if [ $ret -ne 0 ]; then
[[ -e /tmp/fast-reboot-progress || -e /tmp/reboot-progress ]] && sleep infinity
fi
docker exec -it mgmt-framework /usr/sbin/cli/clish_start "$@"

2 changes: 0 additions & 2 deletions sonic-slave-buster/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,6 @@ RUN apt-get update && apt-get install -y \
xsltproc \
python-lxml \
libexpat1-dev \
libcurl3-gnutls \
libcjson-dev \
# For WPA supplication
qtbase5-dev \
aspell-en \
Expand Down