-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Changes to build restapi docker #3993
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} | ||
| FROM docker-config-engine-stretch | ||
|
|
||
| ARG docker_container_name | ||
| RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf | ||
|
|
||
| ## Make apt-get non-interactive | ||
| ENV DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| RUN apt-get update | ||
|
|
||
| ## Install redis-tools dependencies | ||
| ## TODO: implicitly install dependencies | ||
| RUN apt-get -y install libjemalloc1 | ||
| RUN pip install setuptools | ||
|
|
||
| {% if docker_sonic_restapi_debs.strip() -%} | ||
| # Copy locally-built Debian package dependencies | ||
| {{ copy_files("debs/", docker_sonic_restapi_debs.split(' '), "/debs/") }} | ||
|
|
||
| # Install locally-built Debian packages and implicitly install their dependencies | ||
| {{ install_debian_packages( docker_sonic_restapi_debs.split(' ')) }} | ||
| {%- endif %} | ||
|
|
||
| ## Clean up | ||
| RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y | ||
|
|
||
| COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] | ||
|
|
||
| ENTRYPOINT ["/usr/bin/supervisord"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| mkdir -p /var/sonic | ||
| echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status | ||
|
|
||
| rm -f /var/run/rsyslogd.pid | ||
|
|
||
| supervisorctl start rsyslogd | ||
|
|
||
| supervisorctl start restapi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| [supervisord] | ||
| logfile_maxbytes=1MB | ||
| logfile_backups=2 | ||
| nodaemon=true | ||
|
|
||
| [program:restapi] | ||
| command=/usr/sbin/go-server-server -loglevel trace | ||
| priority=1 | ||
| autostart=true | ||
| autorestart=false | ||
| stdout_logfile=/tmp/rest-api.out.log | ||
| stderr_logfile=/tmp/rest-api.err.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # docker image for rest-api | ||
|
|
||
| DOCKER_RESTAPI_STEM = docker-sonic-restapi | ||
| DOCKER_RESTAPI = $(DOCKER_RESTAPI_STEM).gz | ||
|
|
||
| $(DOCKER_RESTAPI)_DEPENDS += $(LIBHIREDIS) $(LIBNL3) $(LIBNL_GENL3) \ | ||
| $(LIBNL_ROUTE3) $(LIBSWSSCOMMON) $(RESTAPI) | ||
|
|
||
| $(DOCKER_RESTAPI)_PATH = $(DOCKERS_PATH)/$(DOCKER_RESTAPI_STEM) | ||
|
|
||
| $(DOCKER_RESTAPI)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) | ||
|
|
||
| SONIC_DOCKER_IMAGES += $(DOCKER_RESTAPI) | ||
| SONIC_STRETCH_DOCKERS += $(DOCKER_RESTAPI) | ||
| SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_RESTAPI) | ||
|
|
||
| $(DOCKER_RESTAPI)_CONTAINER_NAME = rest-api | ||
| $(DOCKER_RESTAPI)_RUN_OPT += --cap-add NET_ADMIN --privileged -t | ||
| $(DOCKER_RESTAPI)_RUN_OPT += -v /var/run/redis/redis.sock:/var/run/redis/redis.sock | ||
| $(DOCKER_RESTAPI)_RUN_OPT += -p=8090:8090/tcp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # sonic-rest-api package | ||
|
|
||
| RESTAPI = sonic-rest-api_1.0.1_amd64.deb | ||
| $(RESTAPI)_SRC_PATH = $(SRC_PATH)/sonic-restapi | ||
| $(RESTAPI)_DEPENDS += $(LIBHIREDIS_DEV) $(LIBNL3_DEV) $(LIBNL_GENL3_DEV) \ | ||
| $(LIBNL_ROUTE3_DEV) $(LIBSWSSCOMMON_DEV) $(LIBSWSSCOMMON) | ||
| $(RESTAPI)_RDEPENDS += $(LIBHIREDIS) $(LIBNL3) $(LIBNL_GENL3) \ | ||
| $(LIBNL_ROUTE3) $(LIBSWSSCOMMON) | ||
| SONIC_DPKG_DEBS += $(RESTAPI) |
Submodule sonic-restapi
added at
163ee2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.