-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[cfggen] Add tool to translate openconfig acl into sonic format #388
Changes from 3 commits
bcd361e
e4d0024
b7486c2
0ed95cf
fa2ff78
982c065
8685acf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,19 +6,42 @@ ENV DEBIAN_FRONTEND=noninteractive | |
RUN apt-get update | ||
|
||
# Dependencies for sonic-cfggen | ||
RUN apt-get install -y python-lxml python-jinja2 python-netaddr python-ipaddr python-yaml | ||
RUN apt-get install -y python-lxml python-yaml python-bitarray python-pip python-dev | ||
|
||
RUN pip install --upgrade pip | ||
|
||
RUN pip install netaddr ipaddr jinja2 pyangbind | ||
|
||
{% if docker_config_engine_debs != '' %} | ||
COPY \ | ||
{% for deb in docker_config_engine_debs.split(' ') -%} | ||
debs/{{ deb }}{{' '}} | ||
{%- endfor -%} | ||
debs/ | ||
{%- endif -%} | ||
|
||
{% if docker_config_engine_debs != '' %} | ||
RUN dpkg -i \ | ||
{% for deb in docker_config_engine_debs.split(' ') -%} | ||
debs/{{ deb }}{{' '}} | ||
{%- endfor %} | ||
{%- endif -%} | ||
|
||
{% if docker_config_engine_whls != '' %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see above #Resolved |
||
COPY \ | ||
{% for whl in docker_config_engine_whls.split(' ') -%} | ||
python-wheels/{{ whl }}{{' '}} | ||
{%- endfor -%} | ||
python-wheels/ | ||
{%- endif -%} | ||
|
||
{% if docker_config_engine_whls != '' %} | ||
RUN pip install \ | ||
{% for whl in docker_config_engine_whls.split(' ') -%} | ||
python-wheels/{{ whl }}{{' '}} | ||
{%- endfor %} | ||
{%- endif -%} | ||
|
||
## Clean up | ||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y | ||
RUN rm -rf /debs | ||
RUN apt-get remove -y python-pip python-dev; apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y | ||
RUN rm -rf /debs /python-wheels |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,17 +54,17 @@ sudo cp $IMAGE_CONFIGS/environment/motd $FILESYSTEM_ROOT/etc/ | |
sudo mkdir -p $FILESYSTEM_ROOT/etc/sonic/ | ||
sudo mkdir -p $FILESYSTEM_ROOT/usr/share/sonic/templates/ | ||
|
||
# Install dependencies for SONiC config engine | ||
# TODO: pip-install instead of apt-get after config engine wrapped into a wheel, even better use pip implicitly installing dependencies | ||
# Install dependencies for SONiC config engine | ||
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install \ | ||
python-dev \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also need to remove python-dev later? #Resolved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's in base image. Do we also care a lot about size here? I prefer we keep it for easier usage of pip. In reply to: 105694773 [](ancestors = 105694773) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we care about size since some switch only have 2G disk, what's the size we are talking about? #Resolved |
||
python-lxml \ | ||
python-jinja2 \ | ||
python-netaddr \ | ||
python-ipaddr \ | ||
python-yaml | ||
python-yaml \ | ||
python-bitarray | ||
|
||
# Install SONiC config engine | ||
sudo dpkg --root=$FILESYSTEM_ROOT -i {{config_engine}} | ||
CONFIG_ENGINE_WHL_NAME=`basename {{config_engine}}` | ||
sudo cp {{config_engine}} $FILESYSTEM_ROOT/$CONFIG_ENGINE_WHL_NAME | ||
sudo chroot $FILESYSTEM_ROOT pip install $CONFIG_ENGINE_WHL_NAME | ||
|
||
# Install SONiC Utilities (and its dependencies via 'apt-get -y install -f') | ||
sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/python-sonic-utilities_*.deb || \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# sonic-config-engine package | ||
|
||
SONIC_CONFIG_ENGINE = python-sonic-config-engine_1.0-1_all.deb | ||
SONIC_CONFIG_ENGINE = sonic_config_engine-1.0-py2-none-any.whl | ||
$(SONIC_CONFIG_ENGINE)_SRC_PATH = $(SRC_PATH)/sonic-config-engine | ||
SONIC_PYTHON_STDEB_DEBS += $(SONIC_CONFIG_ENGINE) | ||
$(SONIC_CONFIG_ENGINE)_PYTHON_VERSION = 2 | ||
SONIC_PYTHON_WHEELS += $(SONIC_CONFIG_ENGINE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-> {% if docker_config_engine_debs.strip() -%} #Resolved