You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2020/09/02 07:51:29 UTC
[GitHub] [trafficcontrol] alficles opened a new pull request #5004: Added transitive source build for ATS.
alficles opened a new pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004
This provides a basic Apache Traffic Server compile, complete with relevant
libraries, that can be used along with Traffic Control.
<!--
************ STOP!! ************
If this Pull Request is intended to fix a security vulnerability, DO NOT submit it! Instead, contact
the Apache Software Foundation Security Team at security@trafficcontrol.apache.org and follow the
guidelines at https://www.apache.org/security/ regarding vulnerability disclosure.
-->
## What does this PR (Pull Request) do?
Adds a transitive source build recipe for producing ATS RPMs that work nicely with ATC, for either testing or production purposes.
<!-- Explain the changes you made here. If this fixes an Issue, identify it by
replacing the text in the checkbox item with the Issue number e.g.
- [x] This PR fixes #9001 OR is not related to any Issue
^ This will automatically close Issue number 9001 when the Pull Request is
merged (The '#' is important).
Be sure you check the box properly, see the "The following criteria are ALL
met by this PR" section for details.
-->
- [ ] This PR fixes is not related to any Issue <!-- You can check for an issue here: https://github.com/apache/trafficcontrol/issues -->
## Which Traffic Control components are affected by this PR?
<!-- Please delete all components from this list that are NOT affected by this
Pull Request. Also, feel free to add the name of a tool or script that is
affected but not on the list.
Additionally, if this Pull Request does NOT affect documentation, please
explain why documentation is not required. -->
- Apache Traffic Server
## What is the best way to verify this PR?
<!-- Please include here ALL the steps necessary to test your Pull Request. If
it includes tests (and most should), outline here the steps needed to run the
tests. If not, lay out the manual testing procedure and please explain why
tests are unnecessary for this Pull Request. -->
Build the RPMs with `./pkg -o` and `./pkg -a` and ensure that the correct RPMs are produced successfully. Additionally, test `./pkg` to ensure that it does not produce these RPMs by default.
## The following criteria are ALL met by this PR
<!-- Check the boxes to signify that the associated statement is true. To
"check a box", replace the space inside of the square brackets with an 'x'.
e.g.
- [ x] <- Wrong
- [x ] <- Wrong
- [] <- Wrong
- [*] <- Wrong
- [x] <- Correct!
-->
- [x] This PR includes tests OR I have explained why tests are unnecessary
- [x] This PR includes documentation OR I have explained why documentation is unnecessary
- [x] This PR includes an update to CHANGELOG.md OR such an update is not necessary
- [x] This PR includes any and all required license headers
- [x] This PR ensures that database migration sequence is correct OR this PR does not include a database migration
- [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://www.apache.org/security/) for details)
## Additional Information
<!-- If you would like to include any additional information on the PR for
potential reviewers please put it here.
Some examples of this would be:
- Before and after screenshots/gifs of the Traffic Portal if it is affected
- Links to other dependent Pull Requests
- References to relevant context (e.g. new/updates to dependent libraries,
mailing list records, blueprints)
Feel free to leave this section blank (or, preferably, delete it entirely).
-->
It might be helpful to review the documentation for `tsb` here: https://comcast.github.io/tsb/
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] alficles commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
alficles commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r533725958
##########
File path: pkg
##########
@@ -134,9 +152,23 @@ while (( "$#" )); do
if (( "$verbose" == 0 )); then
exec >/dev/null 2>&1
fi
+
+ # Build the project
"${COMPOSECMD[@]}" -f $COMPOSE_FILE pull $1 || exit 1
"${COMPOSECMD[@]}" -f $COMPOSE_FILE build --pull $1 || exit 1
"${COMPOSECMD[@]}" -f $COMPOSE_FILE run "${RUN_OPTIONS[@]}" --rm $1 || exit 1
+
+ # Check for a chained compose file for this particular project.
+ # A chained compose file will be named exactly the same as main docker-compose, with .service added,
+ # where <service> is the name of the specific service to be chained. The file may be a symlink to another
+ # compose file, in which case the symlink will be followed before it is processed.
+ # A "dist" symlink will be temporarily created in that directory to facilitate the collation of artefacts.
+ [ ! -e "$COMPOSE_FILE.$1" ] || ln -s "$(dirname -- "$(realpath -e -- "$SELF")")/dist" "$(dirname -- "$(realpath -e -- "$COMPOSE_FILE.$1")")/dist" || exit 1
+ [ ! -e "$COMPOSE_FILE.$1" ] || $SELF -f $(realpath -e "$COMPOSE_FILE.$1") $([ "$verbose" == 0 ] || echo "-v") $([ "$quiet" == 0 ] || echo "-q") $([ "$debug" == 0 ] || echo "-d") $("${COMPOSECMD[@]}" -f $(realpath -e "$COMPOSE_FILE.$1") config --services) || exit 1
+ [ ! -e "$COMPOSE_FILE.$1" ] || rm "$(dirname -- "$(realpath -e -- "$COMPOSE_FILE.$1")")/dist"
Review comment:
Done.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#issuecomment-703835483
TR failed to build in the CI for this PR due to a rate limiting issue that #5036 fixed. Would you please rebase onto master so it can run again?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#issuecomment-738622475
Force-pushing to rebase is fine if the contents if the diffs of the commits themselves don't change in the process (other than to resolve any merge conflicts).
For the sake of reviewers: For future changes, please keep separate your original commit(s) from commits containing changes made in response to PR reviews.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] alficles commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
alficles commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r536315005
##########
File path: infrastructure/docker/build/Dockerfile-tsb
##########
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+ARG RHEL_VERSION=8
+FROM centos:${RHEL_VERSION} as tsb-build
+RUN yum clean all && yum -y install git
+COPY GO_VERSION /
+RUN curl -L https://dl.google.com/go/go$(cat /GO_VERSION).linux-amd64.tar.gz | tar -C /usr/local -xz && ln -s /usr/local/go/bin/go /usr/bin/go
+RUN mkdir -p /go/src/github.com/comcast/tsb && cd /go/src/github.com/comcast/tsb && git init && git remote add origin https://github.com/comcast/tsb && git fetch --depth=1 origin 851be3e137b20ba5d2d1eefd07cd303dc5f53865 && git reset --hard FETCH_HEAD
Review comment:
I have added a comment in the latest commit.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] alficles commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
alficles commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r535899353
##########
File path: pkg
##########
@@ -88,20 +89,27 @@ RUN_OPTIONS=(-e RHEL_VERSION)
# Parse command line arguments
verbose=0
-while getopts :?78bdlpqv opt; do
+debug=0
+quiet=0
+all=0
+build_images=0
+while getopts :?78abdf:lopqv opt; do
case $opt in
\?)
PROJECTS=`$SELF -l | sed "s/^/ - /"`
<<-HELP_TEXT cat
Usage: $SELF [options] [projects]
- -7 Build RPMs targeting CentOS 7 (default)
- -8 Build RPMs targeting CentOS 8
- -b Build builder Docker images before building projects
- -d Disable compiler optimizations for debugging.
- -l List available projects.
- -p Pull builder Docker images, do not build them (default)
- -q Quiet mode. Supresses output. (default)
- -v Verbose mode. Lists all build output.
+ -7 Build RPMs targeting CentOS 7 (default)
+ -8 Build RPMs targeting CentOS 8
+ -a Build all projects, including optional ones.
+ -b Build builder Docker images before building projects
+ -d Disable compiler optimizations for debugging.
+ -f <file> Use <file> as the docker-compose. Default: $COMPOSE_FILE"
+ -l List available projects.
+ -o Build from the optional list. Same as -f "$COMPOSE_FILE_OPT"
+ -p Pull builder Docker images, do not build them (default)
+ -q Quiet mode. Supresses output. (default)
+ -v Verbose mode. Lists all build output.
Review comment:
The whitespace was changed to stay lined up. The addition of a flag with an argument shifted everything to the right. It appears I had some tabs where I thought there were spaces, though, I'll fix that.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman edited a comment on pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman edited a comment on pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#issuecomment-738622475
Force-pushing to rebase is fine if the diffs of the commits themselves don't change in the process (other than to resolve any merge conflicts).
For the sake of reviewers: For future changes, please keep separate your original commit(s) from commits containing changes made in response to PR reviews.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] alficles commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
alficles commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r486658861
##########
File path: traffic_server/tsb/trafficserver.spec
##########
@@ -0,0 +1,151 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+%global src %{_topdir}/SOURCES/src
+%global git_args --git-dir="%{src}/.git" --work-tree="%{src}"
+%global tag %(git %{git_args} describe --long | sed 's/^\\\(.*\\\)-\\\([0-9]\\\+\\\)-g\\\([0-9a-f]\\\+\\\)$/\\\1/' | sed 's/-/_/')
+%global distance %(git %{git_args} describe --long | sed 's/^\\\(.*\\\)-\\\([0-9]\\\+\\\)-g\\\([0-9a-f]\\\+\\\)$/\\\2/')
+%global commit %(git %{git_args} describe --long | sed 's/^\\\(.*\\\)-\\\([0-9]\\\+\\\)-g\\\([0-9a-f]\\\+\\\)$/\\\3/')
+%global git_serial %(git %{git_args} rev-list HEAD | wc -l)
+%global install_prefix "/opt"
+%global api_stats "4096"
+%global _find_debuginfo_dwz_opts %{nil}
+
+Name: trafficserver
+Version: %{tag}
+Epoch: %{git_serial}
+Release: %{distance}.%{commit}%{?dist}
+Summary: Apache Traffic Server
+Vendor: Apache
+Group: Applications/Communications
+License: Apache License, Version 2.0
+URL: https://github.com/apache/trafficserver
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+Requires: tcl, hwloc, pcre, libcap
+BuildRequires: autoconf, automake, libtool, gcc-c++, glibc-devel, expat-devel, pcre, libcap-devel, pcre-devel, perl-ExtUtils-MakeMaker, tcl-devel, hwloc-devel
+Source: src
+
+%description
+Apache Traffic Server with Apache Traffic Control modifications and environment specific modifications
+
+%prep
+%setup -c -T
+cp -far %{src}/. .
+cp -far %{src}/../traffic_server_jemalloc ..
+autoreconf -vfi
+
+%build
+./configure --with-openssl=/opt/trafficserver/openssl --prefix=%{install_prefix}/%{name} --with-user=ats --with-group=ats --with-build-number=%{release} --enable-experimental-plugins --with-max-api-stats=%{api_stats} --disable-unwind
+make %{?_smp_mflags}
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/trafficserver/openssl/lib:/usr/local/lib
+make %{?_smp_mflags} check
+
+%install
+make DESTDIR=$RPM_BUILD_ROOT install
+
+mkdir -p $RPM_BUILD_ROOT/opt/trafficserver/etc/trafficserver/snapshots
+mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system
+cp rc/trafficserver.service $RPM_BUILD_ROOT/usr/lib/systemd/system/
+cp ../traffic_server_jemalloc $RPM_BUILD_ROOT/opt/trafficserver/bin/
+
+mkdir -p $RPM_BUILD_ROOT/opt/trafficserver/openssl
+cp -r /opt/trafficserver/openssl/lib $RPM_BUILD_ROOT/opt/trafficserver/openssl/lib
+
+mkdir -p $RPM_BUILD_ROOT/opt/trafficserver/lua
+cp -r /opt/build/luacrypto/src/.libs/crypto.so $RPM_BUILD_ROOT/opt/trafficserver/lua
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%pre
+id ats &>/dev/null || /usr/sbin/useradd -u 176 -r ats -s /sbin/nologin -d /
+
+%post
+/bin/systemctl daemon-reload
+/bin/systemctl enable trafficserver
+
+%preun
+/bin/systemctl stop trafficserver
+
+# if 0 uninstall, if 1 upgrade
+if [ "$1" = "0" ]; then
+ /bin/systemctl disable trafficserver
+fi
+
+%postun
+# Helpful in understanding order of operations in relation to install/uninstall/upgrade:
+# https://fedoraproject.org/wiki/Packaging:Scriptlets
+
+# Always do this because the service file may have been updated.
+/bin/systemctl daemon-reload
+
+# if 0 uninstall, if 1 upgrade
+if [ "$1" = "0" ]; then
+ id ats &>/dev/null && /usr/sbin/userdel ats
+fi
+
+%files
+%defattr(-,root,root)
+%attr(644,-,-) /usr/lib/systemd/system/trafficserver.service
+%dir /opt/trafficserver
+/opt/trafficserver/openssl
+/opt/trafficserver/lua
+/opt/trafficserver/bin
+/opt/trafficserver/include
+/opt/trafficserver/lib
+/opt/trafficserver/libexec
+/opt/trafficserver/share
+%dir /opt/trafficserver/var
+%attr(-,ats,ats) /opt/trafficserver/var/trafficserver
+%dir /opt/trafficserver/var/log
+%attr(-,ats,ats) /opt/trafficserver/var/log/trafficserver
+%dir /opt/trafficserver/etc
+%attr(-,ats,ats) %dir /opt/trafficserver/etc/trafficserver
+%attr(-,ats,ats) %dir /opt/trafficserver/etc/trafficserver/snapshots
+/opt/trafficserver/etc/trafficserver/body_factory
+/opt/trafficserver/etc/trafficserver/trafficserver-release
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/cache.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/hosting.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/ip_allow.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/logging.yaml
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/parent.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/plugin.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/records.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/remap.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/socks.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/splitdns.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/ssl_multicert.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/ssl_server_name.yaml
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/storage.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/volume.config
+
+%changelog
Review comment:
I considered it, but I'm always leery of removing attribution notices. These changelog entries document the work of the people who's work I'm submitting. I _could_ remove them, but I think I'd prefer to keep them.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r536281835
##########
File path: pkg
##########
@@ -88,20 +89,27 @@ RUN_OPTIONS=(-e RHEL_VERSION)
# Parse command line arguments
verbose=0
-while getopts :?78bdlpqv opt; do
+debug=0
+quiet=0
+all=0
+build_images=0
+while getopts :?78abdf:lopqv opt; do
case $opt in
\?)
PROJECTS=`$SELF -l | sed "s/^/ - /"`
<<-HELP_TEXT cat
Usage: $SELF [options] [projects]
- -7 Build RPMs targeting CentOS 7 (default)
- -8 Build RPMs targeting CentOS 8
- -b Build builder Docker images before building projects
- -d Disable compiler optimizations for debugging.
- -l List available projects.
- -p Pull builder Docker images, do not build them (default)
- -q Quiet mode. Supresses output. (default)
- -v Verbose mode. Lists all build output.
+ -7 Build RPMs targeting CentOS 7 (default)
+ -8 Build RPMs targeting CentOS 8
+ -a Build all projects, including optional ones.
+ -b Build builder Docker images before building projects
+ -d Disable compiler optimizations for debugging.
+ -f <file> Use <file> as the docker-compose. Default: $COMPOSE_FILE
+ -l List available projects.
+ -o Build from the optional list. Same as -f "$COMPOSE_FILE_OPT
Review comment:
Mismatched `"`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r536298625
##########
File path: infrastructure/docker/build/Dockerfile-tsb
##########
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+ARG RHEL_VERSION=8
+FROM centos:${RHEL_VERSION} as tsb-build
+RUN yum clean all && yum -y install git
+COPY GO_VERSION /
+RUN curl -L https://dl.google.com/go/go$(cat /GO_VERSION).linux-amd64.tar.gz | tar -C /usr/local -xz && ln -s /usr/local/go/bin/go /usr/bin/go
+RUN mkdir -p /go/src/github.com/comcast/tsb && cd /go/src/github.com/comcast/tsb && git init && git remote add origin https://github.com/comcast/tsb && git fetch --depth=1 origin 851be3e137b20ba5d2d1eefd07cd303dc5f53865 && git reset --hard FETCH_HEAD
Review comment:
That is an argument against all git tags. Please use a git tag
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] alficles commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
alficles commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r533727283
##########
File path: traffic_server/tsb/run.sh
##########
@@ -0,0 +1,64 @@
+#!/usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+die() {
+ { test -n "$@" && echo "$@"; exit 1; } >&2
+}
+
+mkdir /opt/build
+cp -far /opt/{src,build}/jansson
+cp -far /opt/{src,build}/cjose
+cp -far /opt/{src,build}/openssl
+cp -far /opt/{src,build}/luacrypto
Review comment:
I like it as multiple commands better, but I pulled out the -r.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] alficles commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
alficles commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r533726170
##########
File path: traffic_server/tsb/run.sh
##########
@@ -0,0 +1,64 @@
+#!/usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+die() {
+ { test -n "$@" && echo "$@"; exit 1; } >&2
Review comment:
Eh, I think it's ok. It doesn't hurt readability here.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] ezelkow1 commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
ezelkow1 commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r482258408
##########
File path: infrastructure/docker/build/Dockerfile-tsb
##########
@@ -0,0 +1,32 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+FROM golang:1.13 as tsb-build
+RUN mkdir -p /go/src/github.com/comcast/tsb && cd /go/src/github.com/comcast/tsb && git init && git remote add origin https://github.com/comcast/tsb && git fetch --depth=1 origin 58e38cc84edf2415c05e5c1e78b242c03fa675fa && git reset --hard FETCH_HEAD
+RUN CGOENABLED=0 go install github.com/comcast/tsb
+
+FROM centos:7
+MAINTAINER dev@trafficcontrol.apache.org
+
+RUN yum -y install git sudo
+#ADD https://github.com/docker/compose/releases/download/1.26.2/docker-compose-Linux-x86_64 /usr/bin/docker-compose
Review comment:
should remove if not needed anymore
##########
File path: traffic_server/tsb/trafficserver.spec
##########
@@ -0,0 +1,151 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+%global src %{_topdir}/SOURCES/src
+%global git_args --git-dir="%{src}/.git" --work-tree="%{src}"
+%global tag %(git %{git_args} describe --long | sed 's/^\\\(.*\\\)-\\\([0-9]\\\+\\\)-g\\\([0-9a-f]\\\+\\\)$/\\\1/' | sed 's/-/_/')
+%global distance %(git %{git_args} describe --long | sed 's/^\\\(.*\\\)-\\\([0-9]\\\+\\\)-g\\\([0-9a-f]\\\+\\\)$/\\\2/')
+%global commit %(git %{git_args} describe --long | sed 's/^\\\(.*\\\)-\\\([0-9]\\\+\\\)-g\\\([0-9a-f]\\\+\\\)$/\\\3/')
+%global git_serial %(git %{git_args} rev-list HEAD | wc -l)
+%global install_prefix "/opt"
+%global api_stats "4096"
+%global _find_debuginfo_dwz_opts %{nil}
+
+Name: trafficserver
+Version: %{tag}
+Epoch: %{git_serial}
+Release: %{distance}.%{commit}%{?dist}
+Summary: Apache Traffic Server
+Vendor: Apache
+Group: Applications/Communications
+License: Apache License, Version 2.0
+URL: https://github.com/apache/trafficserver
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+Requires: tcl, hwloc, pcre, libcap
+BuildRequires: autoconf, automake, libtool, gcc-c++, glibc-devel, expat-devel, pcre, libcap-devel, pcre-devel, perl-ExtUtils-MakeMaker, tcl-devel, hwloc-devel
+Source: src
+
+%description
+Apache Traffic Server with Apache Traffic Control modifications and environment specific modifications
+
+%prep
+%setup -c -T
+cp -far %{src}/. .
+cp -far %{src}/../traffic_server_jemalloc ..
+autoreconf -vfi
+
+%build
+./configure --with-openssl=/opt/trafficserver/openssl --prefix=%{install_prefix}/%{name} --with-user=ats --with-group=ats --with-build-number=%{release} --enable-experimental-plugins --with-max-api-stats=%{api_stats} --disable-unwind
+make %{?_smp_mflags}
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/trafficserver/openssl/lib:/usr/local/lib
+make %{?_smp_mflags} check
+
+%install
+make DESTDIR=$RPM_BUILD_ROOT install
+
+mkdir -p $RPM_BUILD_ROOT/opt/trafficserver/etc/trafficserver/snapshots
+mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system
+cp rc/trafficserver.service $RPM_BUILD_ROOT/usr/lib/systemd/system/
+cp ../traffic_server_jemalloc $RPM_BUILD_ROOT/opt/trafficserver/bin/
+
+mkdir -p $RPM_BUILD_ROOT/opt/trafficserver/openssl
+cp -r /opt/trafficserver/openssl/lib $RPM_BUILD_ROOT/opt/trafficserver/openssl/lib
+
+mkdir -p $RPM_BUILD_ROOT/opt/trafficserver/lua
+cp -r /opt/build/luacrypto/src/.libs/crypto.so $RPM_BUILD_ROOT/opt/trafficserver/lua
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%pre
+id ats &>/dev/null || /usr/sbin/useradd -u 176 -r ats -s /sbin/nologin -d /
+
+%post
+/bin/systemctl daemon-reload
+/bin/systemctl enable trafficserver
+
+%preun
+/bin/systemctl stop trafficserver
+
+# if 0 uninstall, if 1 upgrade
+if [ "$1" = "0" ]; then
+ /bin/systemctl disable trafficserver
+fi
+
+%postun
+# Helpful in understanding order of operations in relation to install/uninstall/upgrade:
+# https://fedoraproject.org/wiki/Packaging:Scriptlets
+
+# Always do this because the service file may have been updated.
+/bin/systemctl daemon-reload
+
+# if 0 uninstall, if 1 upgrade
+if [ "$1" = "0" ]; then
+ id ats &>/dev/null && /usr/sbin/userdel ats
+fi
+
+%files
+%defattr(-,root,root)
+%attr(644,-,-) /usr/lib/systemd/system/trafficserver.service
+%dir /opt/trafficserver
+/opt/trafficserver/openssl
+/opt/trafficserver/lua
+/opt/trafficserver/bin
+/opt/trafficserver/include
+/opt/trafficserver/lib
+/opt/trafficserver/libexec
+/opt/trafficserver/share
+%dir /opt/trafficserver/var
+%attr(-,ats,ats) /opt/trafficserver/var/trafficserver
+%dir /opt/trafficserver/var/log
+%attr(-,ats,ats) /opt/trafficserver/var/log/trafficserver
+%dir /opt/trafficserver/etc
+%attr(-,ats,ats) %dir /opt/trafficserver/etc/trafficserver
+%attr(-,ats,ats) %dir /opt/trafficserver/etc/trafficserver/snapshots
+/opt/trafficserver/etc/trafficserver/body_factory
+/opt/trafficserver/etc/trafficserver/trafficserver-release
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/cache.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/hosting.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/ip_allow.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/logging.yaml
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/parent.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/plugin.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/records.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/remap.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/socks.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/splitdns.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/ssl_multicert.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/ssl_server_name.yaml
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/storage.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/volume.config
+
+%changelog
Review comment:
Do we want this full changelog in here, its fairly out of date anyway plus I might consider this going out to opensource to be a fresh start
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r533751110
##########
File path: infrastructure/docker/build/Dockerfile-tsb
##########
@@ -0,0 +1,32 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+FROM golang:1.13 as tsb-build
Review comment:
Apache Traffic Control sticks to supported versions of Go. tsb should stick to being buildable using supported versions of Go, too.
Go 1.13 is not supported, and rather than upgrading multiple Dockerfiles throughout the repo whenever an older version of Go is no longer supported, using `GO_VERSION` saves us a lot of effort in the long run.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#issuecomment-738939416
Fails to build.
```shell
./pkg -o -v
```
```
Building ats.
Pulling ats ...
Pulling ats ... Native build is an experimental feature and could change at any time
Building ats
#2 [internal] load build definition from Dockerfile-tsb
#2 transferring dockerfile: 42B done
#2 DONE 0.3s
#1 [internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.4s
#3 [internal] load metadata for docker.io/library/centos:8
#3 DONE 0.0s
#4 [tsb-build 1/6] FROM docker.io/library/centos:8
#4 CACHED
#9 [internal] load build context
#9 transferring context: 31B done
#9 DONE 0.2s
#5 [stage-1 2/7] RUN YUM -y install git sudo
#5 3.478 CentOS-8 - AppStream 2.4 MB/s | 5.8 MB 00:02
#5 CANCELED
#8 [tsb-build 2/6] RUN yum clean all && yum -y install git
#8 0.877 0 files removed
#8 4.068 CentOS-8 - AppStream 1.9 MB/s | 5.8 MB 00:02
#8 5.622 CentOS-8 - Base 10 kB/s | 6.4 kB 00:00
#8 5.625 Error: Failed to download metadata for repo 'BaseOS': repomd.xml parser error: Parse error at line: 28 (Opening and ending tag mismatch: meta line 0 and head
#8 5.625 )
#8 ERROR: executor failed running [/bin/sh -c yum clean all && yum -y install git]: runc did not terminate sucessfully
------
> [tsb-build 2/6] RUN yum clean all && yum -y install git:
------
failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed running [/bin/sh -c yum clean all && yum -y install git]: runc did not terminate sucessfully
Service 'ats' failed to build
Failed to build ats.
Results in 'dist':
total 0
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r536294056
##########
File path: infrastructure/docker/build/Dockerfile-tsb
##########
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+ARG RHEL_VERSION=8
+FROM centos:${RHEL_VERSION} as tsb-build
+RUN yum clean all && yum -y install git
+COPY GO_VERSION /
+RUN curl -L https://dl.google.com/go/go$(cat /GO_VERSION).linux-amd64.tar.gz | tar -C /usr/local -xz && ln -s /usr/local/go/bin/go /usr/bin/go
+RUN mkdir -p /go/src/github.com/comcast/tsb && cd /go/src/github.com/comcast/tsb && git init && git remote add origin https://github.com/comcast/tsb && git fetch --depth=1 origin 851be3e137b20ba5d2d1eefd07cd303dc5f53865 && git reset --hard FETCH_HEAD
Review comment:
> 851be3e137b20ba5d2d1eefd07cd303dc5f53865
Please tag this commit and use the tag instead
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman edited a comment on pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman edited a comment on pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#issuecomment-738939416
~Fails to build.~
```shell
./pkg -o -v
```
```
Building ats.
Pulling ats ...
Pulling ats ... Native build is an experimental feature and could change at any time
Building ats
#2 [internal] load build definition from Dockerfile-tsb
#2 transferring dockerfile: 42B done
#2 DONE 0.3s
#1 [internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.4s
#3 [internal] load metadata for docker.io/library/centos:8
#3 DONE 0.0s
#4 [tsb-build 1/6] FROM docker.io/library/centos:8
#4 CACHED
#9 [internal] load build context
#9 transferring context: 31B done
#9 DONE 0.2s
#5 [stage-1 2/7] RUN YUM -y install git sudo
#5 3.478 CentOS-8 - AppStream 2.4 MB/s | 5.8 MB 00:02
#5 CANCELED
#8 [tsb-build 2/6] RUN yum clean all && yum -y install git
#8 0.877 0 files removed
#8 4.068 CentOS-8 - AppStream 1.9 MB/s | 5.8 MB 00:02
#8 5.622 CentOS-8 - Base 10 kB/s | 6.4 kB 00:00
#8 5.625 Error: Failed to download metadata for repo 'BaseOS': repomd.xml parser error: Parse error at line: 28 (Opening and ending tag mismatch: meta line 0 and head
#8 5.625 )
#8 ERROR: executor failed running [/bin/sh -c yum clean all && yum -y install git]: runc did not terminate sucessfully
------
> [tsb-build 2/6] RUN yum clean all && yum -y install git:
------
failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed running [/bin/sh -c yum clean all && yum -y install git]: runc did not terminate sucessfully
Service 'ats' failed to build
Failed to build ats.
Results in 'dist':
total 0
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r533746095
##########
File path: infrastructure/docker/build/Dockerfile-tsb
##########
@@ -0,0 +1,32 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+FROM golang:1.13 as tsb-build
Review comment:
Our repo no longer references Go versions in multiple places and instead downloads the version of Go specified by the [`GO_VERSION`](https://github.com/apache/trafficcontrol/blob/f8b34009c6/GO_VERSION) file at the root of the project working tree.
See #5095 for examples of modifying Dockerfiles with a `golang:1.##.#` base image to use `GO_VERSION` with a `debian:buster` base image.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r536209074
##########
File path: pkg
##########
@@ -88,20 +89,27 @@ RUN_OPTIONS=(-e RHEL_VERSION)
# Parse command line arguments
verbose=0
-while getopts :?78bdlpqv opt; do
+debug=0
+quiet=0
+all=0
+build_images=0
+while getopts :?78abdf:lopqv opt; do
case $opt in
\?)
PROJECTS=`$SELF -l | sed "s/^/ - /"`
<<-HELP_TEXT cat
Usage: $SELF [options] [projects]
- -7 Build RPMs targeting CentOS 7 (default)
- -8 Build RPMs targeting CentOS 8
- -b Build builder Docker images before building projects
- -d Disable compiler optimizations for debugging.
- -l List available projects.
- -p Pull builder Docker images, do not build them (default)
- -q Quiet mode. Supresses output. (default)
- -v Verbose mode. Lists all build output.
+ -7 Build RPMs targeting CentOS 7 (default)
+ -8 Build RPMs targeting CentOS 8
+ -a Build all projects, including optional ones.
+ -b Build builder Docker images before building projects
+ -d Disable compiler optimizations for debugging.
+ -f <file> Use <file> as the docker-compose. Default: $COMPOSE_FILE"
Review comment:
Unmatched `"`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman merged pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman merged pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r482303017
##########
File path: pkg
##########
@@ -134,9 +152,23 @@ while (( "$#" )); do
if (( "$verbose" == 0 )); then
exec >/dev/null 2>&1
fi
+
+ # Build the project
"${COMPOSECMD[@]}" -f $COMPOSE_FILE pull $1 || exit 1
"${COMPOSECMD[@]}" -f $COMPOSE_FILE build --pull $1 || exit 1
"${COMPOSECMD[@]}" -f $COMPOSE_FILE run "${RUN_OPTIONS[@]}" --rm $1 || exit 1
+
+ # Check for a chained compose file for this particular project.
+ # A chained compose file will be named exactly the same as main docker-compose, with .service added,
+ # where <service> is the name of the specific service to be chained. The file may be a symlink to another
+ # compose file, in which case the symlink will be followed before it is processed.
+ # A "dist" symlink will be temporarily created in that directory to facilitate the collation of artefacts.
+ [ ! -e "$COMPOSE_FILE.$1" ] || ln -s "$(dirname -- "$(realpath -e -- "$SELF")")/dist" "$(dirname -- "$(realpath -e -- "$COMPOSE_FILE.$1")")/dist" || exit 1
+ [ ! -e "$COMPOSE_FILE.$1" ] || $SELF -f $(realpath -e "$COMPOSE_FILE.$1") $([ "$verbose" == 0 ] || echo "-v") $([ "$quiet" == 0 ] || echo "-q") $([ "$debug" == 0 ] || echo "-d") $("${COMPOSECMD[@]}" -f $(realpath -e "$COMPOSE_FILE.$1") config --services) || exit 1
+ [ ! -e "$COMPOSE_FILE.$1" ] || rm "$(dirname -- "$(realpath -e -- "$COMPOSE_FILE.$1")")/dist"
Review comment:
This should be in an `if` statement instead of checking `! -e` 3 times
##########
File path: traffic_server/tsb/Dockerfile
##########
@@ -0,0 +1,75 @@
+# Licensed to the Apache Software Fou:qndation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+FROM centos:7
+
+RUN yum clean all \
+ && yum install -y deltarpm epel-release centos-release-scl-rh \
+ && yum-config-manager --enable rhel-server-rhscl-7-rpms \
+ && yum clean all \
+ && yum install -y \
+ autoconf \
+ automake \
+ pkgconfig \
+ libtool \
+ perl-ExtUtils-MakeMaker \
+ gcc-c++ \
+ glibc-devel \
+ tcl-devel \
+ expat-devel \
+ pcre \
+ pcre-devel \
+ libcap-devel \
+ flex \
+ hwloc-devel \
+ libuuid-devel \
+ lua-devel \
+ make \
+ git \
+ rpm-build \
+ man \
+ sudo \
+ python3 \
+ python35 \
+ ed \
+ zlib \
+ zlib-devel \
+ ncurses-devel \
+ libcurl-devel \
+ devtoolset-7 \
+ luajit-devel \
+ openssl \
+ openssl-devel \
+ hwloc \
+ perl-URI \
+ nmap-ncat \
+ perl-Digest-SHA \
+ nano \
+ ed \
+ && yum clean all
+
+ADD jansson.pic.patch /opt/src/
+ADD cjose.pic.patch /opt/src/
+ADD https://bootstrap.pypa.io/get-pip.py /
+RUN python get-pip.py
+RUN pip install --user Sphinx
+ADD run.sh /
+ADD trafficserver.spec /rpmbuilddir/SPECS/trafficserver.spec
+ADD traffic_server_jemalloc /rpmbuilddir/SOURCES/traffic_server_jemalloc
+RUN /usr/sbin/useradd -u 176 -r ats -s /sbin/nologin -d /
+CMD set -o pipefail; scl enable devtoolset-7 ./run.sh 2>&1 | tee /rpmbuilddir/RPMS/x86_64/build.log
Review comment:
`CMD set -o pipefail` fails with some base images (e.g., `debian`), so that command should follow the Dockerfile convention of using `&&`, not `;`.
##########
File path: traffic_server/tsb/Dockerfile
##########
@@ -0,0 +1,75 @@
+# Licensed to the Apache Software Fou:qndation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+FROM centos:7
+
+RUN yum clean all \
+ && yum install -y deltarpm epel-release centos-release-scl-rh \
+ && yum-config-manager --enable rhel-server-rhscl-7-rpms \
+ && yum clean all \
+ && yum install -y \
+ autoconf \
+ automake \
+ pkgconfig \
+ libtool \
+ perl-ExtUtils-MakeMaker \
+ gcc-c++ \
+ glibc-devel \
+ tcl-devel \
+ expat-devel \
+ pcre \
+ pcre-devel \
+ libcap-devel \
+ flex \
+ hwloc-devel \
+ libuuid-devel \
+ lua-devel \
+ make \
+ git \
+ rpm-build \
+ man \
+ sudo \
+ python3 \
+ python35 \
+ ed \
+ zlib \
+ zlib-devel \
+ ncurses-devel \
+ libcurl-devel \
+ devtoolset-7 \
+ luajit-devel \
+ openssl \
+ openssl-devel \
+ hwloc \
+ perl-URI \
+ nmap-ncat \
+ perl-Digest-SHA \
+ nano \
+ ed \
Review comment:
Is there something significant about this particular package order?
* If so, that significance should be commented.
* If not, the list should be alphabetized.
##########
File path: traffic_server/tsb/run.sh
##########
@@ -0,0 +1,64 @@
+#!/usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+die() {
+ { test -n "$@" && echo "$@"; exit 1; } >&2
Review comment:
The only command here with console output is `echo "$@"`, so the curly braces are unnecessary.
##########
File path: traffic_server/tsb/patches.yml
##########
@@ -0,0 +1,15 @@
+ats:
+- f5ac00f3606bd826c52552e59f067d3fe3fcda33
+- 721f8ffca6ee8782573084c671e45ce392d239ef
+- d295784ba57af7e8e2dba09b85a1cbcaacf797f3
+- ef57a68f4f9d6f6dd5563cff82cddb8adcb8c28c
+- abe7a933e403b88f1b13ab7f2ebdd6ce95202b42
+- 9ac557ba3c0f28979c996cb49a827940bfb569d8
+- 72e582d3de630008641e7849f7cd42b11f6f081b
+- ad33e0fff0091093cd31fcfd429933299cb8bf5b
+- 1f13f346ef9ae4c0035f5755af4fd28b6f84f1e0
+- fc66eea820c8ba44196f2051aa41aedd7b874b0b
+- 5b38fb26737b38267615102775d81136a843075c
+openssl:
+- ec6788fb8ca0704b503c3a0030a142d9805895a6
Review comment:
We'll need a comment for each commit hash in this patch list describing its significance
##########
File path: traffic_server/tsb/Dockerfile
##########
@@ -0,0 +1,75 @@
+# Licensed to the Apache Software Fou:qndation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+FROM centos:7
+
+RUN yum clean all \
+ && yum install -y deltarpm epel-release centos-release-scl-rh \
+ && yum-config-manager --enable rhel-server-rhscl-7-rpms \
+ && yum clean all \
+ && yum install -y \
+ autoconf \
+ automake \
+ pkgconfig \
+ libtool \
+ perl-ExtUtils-MakeMaker \
+ gcc-c++ \
+ glibc-devel \
+ tcl-devel \
+ expat-devel \
+ pcre \
+ pcre-devel \
+ libcap-devel \
+ flex \
+ hwloc-devel \
+ libuuid-devel \
+ lua-devel \
+ make \
+ git \
+ rpm-build \
+ man \
+ sudo \
+ python3 \
+ python35 \
+ ed \
Review comment:
`ed` appears in the package list twice
##########
File path: traffic_server/tsb/Dockerfile
##########
@@ -0,0 +1,75 @@
+# Licensed to the Apache Software Fou:qndation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+FROM centos:7
+
+RUN yum clean all \
+ && yum install -y deltarpm epel-release centos-release-scl-rh \
+ && yum-config-manager --enable rhel-server-rhscl-7-rpms \
+ && yum clean all \
+ && yum install -y \
+ autoconf \
+ automake \
+ pkgconfig \
+ libtool \
+ perl-ExtUtils-MakeMaker \
+ gcc-c++ \
+ glibc-devel \
+ tcl-devel \
+ expat-devel \
+ pcre \
+ pcre-devel \
+ libcap-devel \
+ flex \
+ hwloc-devel \
+ libuuid-devel \
+ lua-devel \
+ make \
+ git \
+ rpm-build \
+ man \
+ sudo \
+ python3 \
+ python35 \
+ ed \
+ zlib \
+ zlib-devel \
+ ncurses-devel \
+ libcurl-devel \
+ devtoolset-7 \
+ luajit-devel \
+ openssl \
+ openssl-devel \
+ hwloc \
+ perl-URI \
+ nmap-ncat \
+ perl-Digest-SHA \
+ nano \
+ ed \
+ && yum clean all
+
+ADD jansson.pic.patch /opt/src/
+ADD cjose.pic.patch /opt/src/
+ADD https://bootstrap.pypa.io/get-pip.py /
+RUN python get-pip.py
+RUN pip install --user Sphinx
+ADD run.sh /
+ADD trafficserver.spec /rpmbuilddir/SPECS/trafficserver.spec
+ADD traffic_server_jemalloc /rpmbuilddir/SOURCES/traffic_server_jemalloc
Review comment:
Use `COPY` for local files so the stuff that is added from a remote source sticks out.
##########
File path: traffic_server/tsb/repos.yml
##########
@@ -0,0 +1,32 @@
+ats:
+ src: https://github.com/apache/trafficserver.git
+ branch: 8.0.x
+ head: a29528dffb8ea1c6fa57fe0c76ca1ec9d0f08694
+ extra:
+ - https://github.com/jrushford/trafficserver.git
+ - https://github.com/traeak/trafficserver.git
+cjose:
+ src: https://github.com/cisco/cjose
+ branch: master
+ head: 254ab05e04cc32d866712bea838990eb4011cbf5
+ extra: []
+jansson:
+ src: https://github.com/akheron/jansson
+ branch: master
+ head: aed855e6920923898b94a1b922fbace27a34ddf2
+ extra: []
+luacrypto:
+ src: https://github.com/mkottman/luacrypto.git
+ branch: master
+ head: 8c3f7f0caf023fe327f9e60391fc80df2d08a169
+ extra: []
+openssl:
+ src: https://github.com/openssl/openssl.git
+ branch: OpenSSL_1_1_1
+ head: 1708e3e85b4a86bae26860aa5d2913fc8eff6086
+ extra: []
+trafficcontrol:
+ src: https://github.com/apache/trafficcontrol
Review comment:
Some of these remotes end with `.git` and some do not. It should be consistent
##########
File path: traffic_server/tsb/run.sh
##########
@@ -0,0 +1,64 @@
+#!/usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+die() {
+ { test -n "$@" && echo "$@"; exit 1; } >&2
+}
+
+mkdir /opt/build
+cp -far /opt/{src,build}/jansson
+cp -far /opt/{src,build}/cjose
+cp -far /opt/{src,build}/openssl
+cp -far /opt/{src,build}/luacrypto
Review comment:
`-r` is unnecessary if `-a` is specified, and the 4 lines can be simplified to 1 line like
```bash
cp -fa /opt/src/{cjose,jansson,luacrypto,openssl} /opt/build
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r536365028
##########
File path: pkg
##########
@@ -156,12 +175,28 @@ while (( "$#" )); do
if (( "$verbose" == 0 )); then
exec >/dev/null 2>&1
fi
+
+ # Build the project
if [[ $build_images -eq 1 ]]; then
"${COMPOSECMD[@]}" -f $COMPOSE_FILE build $1 || exit 1
else
"${COMPOSECMD[@]}" -f $COMPOSE_FILE pull $1 || exit 1
fi
"${COMPOSECMD[@]}" -f $COMPOSE_FILE run "${RUN_OPTIONS[@]}" --rm $1 || exit 1
+
+ # Check for a chained compose file for this particular project.
+ # A chained compose file will be named exactly the same as main docker-compose, with .service added,
+ # where <service> is the name of the specific service to be chained. The file may be a symlink to another
+ # compose file, in which case the symlink will be followed before it is processed.
+ # A "dist" symlink will be temporarily created in that directory to facilitate the collation of artefacts.
+ if [ -e "$COMPOSE_FILE.$1" ] ; then
+ ln -sf "$(dirname -- "$(realpath -e -- "$SELF")")/dist" "$(dirname -- "$(realpath -e -- "$COMPOSE_FILE.$1")")/dist" || exit 1
+ $SELF -f $(realpath -e "$COMPOSE_FILE.$1") $([ "$verbose" == 0 ] || echo "-v") $([ "$quiet" == 0 ] || echo "-q") $([ "$debug" == 0 ] || echo "-d") $([ "$build" == 0 ] || echo "-b") $("${COMPOSECMD[@]}" -f $(realpath -e "$COMPOSE_FILE.$1") config --services) || exit 1
+ rm "$(dirname -- "$(realpath -e -- "$COMPOSE_FILE.$1")")/dist"
+ fi
+
+ # Update the ownership of the artefacts to match the main repo.
+ chown -R "$(stat -c '%u:%g' .)" dist
Review comment:
This permissions issue will affect people using the optional docker-compose, so people building other components won't be affected. We can address this later.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] alficles commented on pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
alficles commented on pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#issuecomment-690756203
I'll investigate removing luacrypto and update.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] alficles commented on pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
alficles commented on pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#issuecomment-738625828
I did have to rebase this on to master in order to handle the GO_VERSION stuff, because none of that was in the version I had built off of.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] alficles commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
alficles commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r533726390
##########
File path: traffic_server/tsb/patches.yml
##########
@@ -0,0 +1,15 @@
+ats:
+- f5ac00f3606bd826c52552e59f067d3fe3fcda33
+- 721f8ffca6ee8782573084c671e45ce392d239ef
+- d295784ba57af7e8e2dba09b85a1cbcaacf797f3
+- ef57a68f4f9d6f6dd5563cff82cddb8adcb8c28c
+- abe7a933e403b88f1b13ab7f2ebdd6ce95202b42
+- 9ac557ba3c0f28979c996cb49a827940bfb569d8
+- 72e582d3de630008641e7849f7cd42b11f6f081b
+- ad33e0fff0091093cd31fcfd429933299cb8bf5b
+- 1f13f346ef9ae4c0035f5755af4fd28b6f84f1e0
+- fc66eea820c8ba44196f2051aa41aedd7b874b0b
+- 5b38fb26737b38267615102775d81136a843075c
+openssl:
+- ec6788fb8ca0704b503c3a0030a142d9805895a6
Review comment:
I have added this support to the latest version of tsb and updated accordingly.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] alficles commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
alficles commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r535883638
##########
File path: infrastructure/docker/build/Dockerfile-tsb
##########
@@ -0,0 +1,32 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+FROM golang:1.13 as tsb-build
Review comment:
Ok, I went ahead and switched this to a generic image. It's not super-likely to break and if it does, the ATC team will notice so we can open a PR to fix it. :D
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] rob05c commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
rob05c commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r536306063
##########
File path: infrastructure/docker/build/Dockerfile-tsb
##########
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+ARG RHEL_VERSION=8
+FROM centos:${RHEL_VERSION} as tsb-build
+RUN yum clean all && yum -y install git
+COPY GO_VERSION /
+RUN curl -L https://dl.google.com/go/go$(cat /GO_VERSION).linux-amd64.tar.gz | tar -C /usr/local -xz && ln -s /usr/local/go/bin/go /usr/bin/go
+RUN mkdir -p /go/src/github.com/comcast/tsb && cd /go/src/github.com/comcast/tsb && git init && git remote add origin https://github.com/comcast/tsb && git fetch --depth=1 origin 851be3e137b20ba5d2d1eefd07cd303dc5f53865 && git reset --hard FETCH_HEAD
Review comment:
I'm with @alficles, I think the actual commit is safer and more accurate here.
Also, this is a commit in github.com/comcast/tsb, unless I'm mistaken? Apache Traffic Control doesn't really have authority to demand changes to other repos (some individuals here have the influence in this particular case, but that isn't always going to be true).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] alficles commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
alficles commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r536296497
##########
File path: infrastructure/docker/build/Dockerfile-tsb
##########
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+ARG RHEL_VERSION=8
+FROM centos:${RHEL_VERSION} as tsb-build
+RUN yum clean all && yum -y install git
+COPY GO_VERSION /
+RUN curl -L https://dl.google.com/go/go$(cat /GO_VERSION).linux-amd64.tar.gz | tar -C /usr/local -xz && ln -s /usr/local/go/bin/go /usr/bin/go
+RUN mkdir -p /go/src/github.com/comcast/tsb && cd /go/src/github.com/comcast/tsb && git init && git remote add origin https://github.com/comcast/tsb && git fetch --depth=1 origin 851be3e137b20ba5d2d1eefd07cd303dc5f53865 && git reset --hard FETCH_HEAD
Review comment:
Tags can change, commit hashes cannot. I believe the commit hash is the less ambiguous mechanism.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] alficles commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
alficles commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r533746884
##########
File path: infrastructure/docker/build/Dockerfile-tsb
##########
@@ -0,0 +1,32 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+FROM golang:1.13 as tsb-build
Review comment:
tsb does not necessarily run the same version of go as Traffic Control and go is not backward compatible between versions.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] alficles commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
alficles commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r486657948
##########
File path: infrastructure/docker/build/Dockerfile-tsb
##########
@@ -0,0 +1,32 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+FROM golang:1.13 as tsb-build
+RUN mkdir -p /go/src/github.com/comcast/tsb && cd /go/src/github.com/comcast/tsb && git init && git remote add origin https://github.com/comcast/tsb && git fetch --depth=1 origin 58e38cc84edf2415c05e5c1e78b242c03fa675fa && git reset --hard FETCH_HEAD
+RUN CGOENABLED=0 go install github.com/comcast/tsb
+
+FROM centos:7
+MAINTAINER dev@trafficcontrol.apache.org
+
+RUN yum -y install git sudo
+#ADD https://github.com/docker/compose/releases/download/1.26.2/docker-compose-Linux-x86_64 /usr/bin/docker-compose
Review comment:
It's not precisely "not needed" entirely. But the existing use case doesn't require mounting the docker socket. I left it in intentionally to show where that would normally come from. I could probably have put a comment in there explaining, though.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] alficles commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
alficles commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r533726837
##########
File path: traffic_server/tsb/Dockerfile
##########
@@ -0,0 +1,75 @@
+# Licensed to the Apache Software Fou:qndation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+FROM centos:7
+
+RUN yum clean all \
+ && yum install -y deltarpm epel-release centos-release-scl-rh \
+ && yum-config-manager --enable rhel-server-rhscl-7-rpms \
+ && yum clean all \
+ && yum install -y \
+ autoconf \
+ automake \
+ pkgconfig \
+ libtool \
+ perl-ExtUtils-MakeMaker \
+ gcc-c++ \
+ glibc-devel \
+ tcl-devel \
+ expat-devel \
+ pcre \
+ pcre-devel \
+ libcap-devel \
+ flex \
+ hwloc-devel \
+ libuuid-devel \
+ lua-devel \
+ make \
+ git \
+ rpm-build \
+ man \
+ sudo \
+ python3 \
+ python35 \
+ ed \
+ zlib \
+ zlib-devel \
+ ncurses-devel \
+ libcurl-devel \
+ devtoolset-7 \
+ luajit-devel \
+ openssl \
+ openssl-devel \
+ hwloc \
+ perl-URI \
+ nmap-ncat \
+ perl-Digest-SHA \
+ nano \
+ ed \
+ && yum clean all
+
+ADD jansson.pic.patch /opt/src/
+ADD cjose.pic.patch /opt/src/
+ADD https://bootstrap.pypa.io/get-pip.py /
+RUN python get-pip.py
+RUN pip install --user Sphinx
+ADD run.sh /
+ADD trafficserver.spec /rpmbuilddir/SPECS/trafficserver.spec
+ADD traffic_server_jemalloc /rpmbuilddir/SOURCES/traffic_server_jemalloc
+RUN /usr/sbin/useradd -u 176 -r ats -s /sbin/nologin -d /
+CMD set -o pipefail; scl enable devtoolset-7 ./run.sh 2>&1 | tee /rpmbuilddir/RPMS/x86_64/build.log
Review comment:
Yeah, but we're not using debian. It works for this image and since the whole point of this image is building RPMs, it's unlikely that someone will swap the base image out. I'm leaving this one for now, I think.
##########
File path: traffic_server/tsb/Dockerfile
##########
@@ -0,0 +1,75 @@
+# Licensed to the Apache Software Fou:qndation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+FROM centos:7
+
+RUN yum clean all \
+ && yum install -y deltarpm epel-release centos-release-scl-rh \
+ && yum-config-manager --enable rhel-server-rhscl-7-rpms \
+ && yum clean all \
+ && yum install -y \
+ autoconf \
+ automake \
+ pkgconfig \
+ libtool \
+ perl-ExtUtils-MakeMaker \
+ gcc-c++ \
+ glibc-devel \
+ tcl-devel \
+ expat-devel \
+ pcre \
+ pcre-devel \
+ libcap-devel \
+ flex \
+ hwloc-devel \
+ libuuid-devel \
+ lua-devel \
+ make \
+ git \
+ rpm-build \
+ man \
+ sudo \
+ python3 \
+ python35 \
+ ed \
+ zlib \
+ zlib-devel \
+ ncurses-devel \
+ libcurl-devel \
+ devtoolset-7 \
+ luajit-devel \
+ openssl \
+ openssl-devel \
+ hwloc \
+ perl-URI \
+ nmap-ncat \
+ perl-Digest-SHA \
+ nano \
+ ed \
Review comment:
Done.
##########
File path: traffic_server/tsb/Dockerfile
##########
@@ -0,0 +1,75 @@
+# Licensed to the Apache Software Fou:qndation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+FROM centos:7
+
+RUN yum clean all \
+ && yum install -y deltarpm epel-release centos-release-scl-rh \
+ && yum-config-manager --enable rhel-server-rhscl-7-rpms \
+ && yum clean all \
+ && yum install -y \
+ autoconf \
+ automake \
+ pkgconfig \
+ libtool \
+ perl-ExtUtils-MakeMaker \
+ gcc-c++ \
+ glibc-devel \
+ tcl-devel \
+ expat-devel \
+ pcre \
+ pcre-devel \
+ libcap-devel \
+ flex \
+ hwloc-devel \
+ libuuid-devel \
+ lua-devel \
+ make \
+ git \
+ rpm-build \
+ man \
+ sudo \
+ python3 \
+ python35 \
+ ed \
Review comment:
Done.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r499832665
##########
File path: traffic_server/tsb/Dockerfile
##########
@@ -0,0 +1,75 @@
+# Licensed to the Apache Software Fou:qndation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+FROM centos:7
+
+RUN yum clean all \
+ && yum install -y deltarpm epel-release centos-release-scl-rh \
+ && yum-config-manager --enable rhel-server-rhscl-7-rpms \
+ && yum clean all \
+ && yum install -y \
+ autoconf \
+ automake \
+ pkgconfig \
+ libtool \
+ perl-ExtUtils-MakeMaker \
+ gcc-c++ \
+ glibc-devel \
+ tcl-devel \
+ expat-devel \
+ pcre \
+ pcre-devel \
+ libcap-devel \
+ flex \
+ hwloc-devel \
+ libuuid-devel \
+ lua-devel \
+ make \
+ git \
+ rpm-build \
+ man \
+ sudo \
+ python3 \
+ python35 \
+ ed \
Review comment:
so do python3, python35 (which are themselves redundant), and sudo
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#issuecomment-738952514
> Fails to build.
Scratch that, I just needed to restart Docker
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r536312904
##########
File path: infrastructure/docker/build/Dockerfile-tsb
##########
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+ARG RHEL_VERSION=8
+FROM centos:${RHEL_VERSION} as tsb-build
+RUN yum clean all && yum -y install git
+COPY GO_VERSION /
+RUN curl -L https://dl.google.com/go/go$(cat /GO_VERSION).linux-amd64.tar.gz | tar -C /usr/local -xz && ln -s /usr/local/go/bin/go /usr/bin/go
+RUN mkdir -p /go/src/github.com/comcast/tsb && cd /go/src/github.com/comcast/tsb && git init && git remote add origin https://github.com/comcast/tsb && git fetch --depth=1 origin 851be3e137b20ba5d2d1eefd07cd303dc5f53865 && git reset --hard FETCH_HEAD
Review comment:
> I'm with @alficles, I think the actual commit is safer and more accurate here.
> Also, this is a commit in github.com/comcast/tsb, unless I'm mistaken? Apache Traffic Control doesn't really have authority to demand changes to other repos (some individuals here have the influence in this particular case, but that isn't always going to be true).
Fair enough, there's no need to add a tag, I just assumed he would prefer a tag to a branch. But using a branch and checking the commit hash is fine, too.
Using a git tag or git branch and verifying the commit hash is no less secure than using a commit hash directly, yet it helps human-readability immensely.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r536294056
##########
File path: infrastructure/docker/build/Dockerfile-tsb
##########
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+ARG RHEL_VERSION=8
+FROM centos:${RHEL_VERSION} as tsb-build
+RUN yum clean all && yum -y install git
+COPY GO_VERSION /
+RUN curl -L https://dl.google.com/go/go$(cat /GO_VERSION).linux-amd64.tar.gz | tar -C /usr/local -xz && ln -s /usr/local/go/bin/go /usr/bin/go
+RUN mkdir -p /go/src/github.com/comcast/tsb && cd /go/src/github.com/comcast/tsb && git init && git remote add origin https://github.com/comcast/tsb && git fetch --depth=1 origin 851be3e137b20ba5d2d1eefd07cd303dc5f53865 && git reset --hard FETCH_HEAD
Review comment:
> 851be3e137b20ba5d2d1eefd07cd303dc5f53865
Please tag this commit and use the tag instead
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r535891206
##########
File path: pkg
##########
@@ -88,20 +89,27 @@ RUN_OPTIONS=(-e RHEL_VERSION)
# Parse command line arguments
verbose=0
-while getopts :?78bdlpqv opt; do
+debug=0
+quiet=0
+all=0
+build_images=0
+while getopts :?78abdf:lopqv opt; do
case $opt in
\?)
PROJECTS=`$SELF -l | sed "s/^/ - /"`
<<-HELP_TEXT cat
Usage: $SELF [options] [projects]
- -7 Build RPMs targeting CentOS 7 (default)
- -8 Build RPMs targeting CentOS 8
- -b Build builder Docker images before building projects
- -d Disable compiler optimizations for debugging.
- -l List available projects.
- -p Pull builder Docker images, do not build them (default)
- -q Quiet mode. Supresses output. (default)
- -v Verbose mode. Lists all build output.
+ -7 Build RPMs targeting CentOS 7 (default)
+ -8 Build RPMs targeting CentOS 8
+ -a Build all projects, including optional ones.
+ -b Build builder Docker images before building projects
+ -d Disable compiler optimizations for debugging.
+ -f <file> Use <file> as the docker-compose. Default: $COMPOSE_FILE"
+ -l List available projects.
+ -o Build from the optional list. Same as -f "$COMPOSE_FILE_OPT"
+ -p Pull builder Docker images, do not build them (default)
+ -q Quiet mode. Supresses output. (default)
+ -v Verbose mode. Lists all build output.
Review comment:
The whitespace should not change for flags that were not added. For flags that were added (`-f` and `-o`), those lines needs to begin with 3 tabs.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r536333574
##########
File path: pkg
##########
@@ -156,12 +175,28 @@ while (( "$#" )); do
if (( "$verbose" == 0 )); then
exec >/dev/null 2>&1
fi
+
+ # Build the project
if [[ $build_images -eq 1 ]]; then
"${COMPOSECMD[@]}" -f $COMPOSE_FILE build $1 || exit 1
else
"${COMPOSECMD[@]}" -f $COMPOSE_FILE pull $1 || exit 1
fi
"${COMPOSECMD[@]}" -f $COMPOSE_FILE run "${RUN_OPTIONS[@]}" --rm $1 || exit 1
+
+ # Check for a chained compose file for this particular project.
+ # A chained compose file will be named exactly the same as main docker-compose, with .service added,
+ # where <service> is the name of the specific service to be chained. The file may be a symlink to another
+ # compose file, in which case the symlink will be followed before it is processed.
+ # A "dist" symlink will be temporarily created in that directory to facilitate the collation of artefacts.
+ if [ -e "$COMPOSE_FILE.$1" ] ; then
+ ln -sf "$(dirname -- "$(realpath -e -- "$SELF")")/dist" "$(dirname -- "$(realpath -e -- "$COMPOSE_FILE.$1")")/dist" || exit 1
+ $SELF -f $(realpath -e "$COMPOSE_FILE.$1") $([ "$verbose" == 0 ] || echo "-v") $([ "$quiet" == 0 ] || echo "-q") $([ "$debug" == 0 ] || echo "-d") $([ "$build" == 0 ] || echo "-b") $("${COMPOSECMD[@]}" -f $(realpath -e "$COMPOSE_FILE.$1") config --services) || exit 1
+ rm "$(dirname -- "$(realpath -e -- "$COMPOSE_FILE.$1")")/dist"
+ fi
+
+ # Update the ownership of the artefacts to match the main repo.
+ chown -R "$(stat -c '%u:%g' .)" dist
Review comment:
This line causes the build to "fail" (even though the RPMs are successfully built) when `pkg` is not run using `sudo`:
```
Requires(rpmlib): rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1
Checking for unpackaged file(s): /usr/lib/rpm/check-files /rpmbuilddir/BUILDROOT/trafficserver-8.0.8-11.3a53261.el7.x86_64
Wrote: /rpmbuilddir/RPMS/x86_64/trafficserver-8.0.8-11.3a53261.el7.x86_64.rpm
Wrote: /rpmbuilddir/RPMS/x86_64/trafficserver-debuginfo-8.0.8-11.3a53261.el7.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.lnPh60
+ umask 022
+ cd /rpmbuilddir/BUILD
+ cd trafficserver-8.0.8
+ rm -rf /rpmbuilddir/BUILDROOT/trafficserver-8.0.8-11.3a53261.el7.x86_64
+ exit 0
chown: changing ownership of 'dist/trafficserver-debuginfo-8.0.8-11.3a53261.el7.x86_64.rpm': Operation not permitted
chown: changing ownership of 'dist/build.log': Operation not permitted
chown: changing ownership of 'dist/trafficserver-8.0.8-11.3a53261.el7.x86_64.rpm': Operation not permitted
Failed to build ats_build.
Results in 'dist':
total 58376
-rw-r--r-- 1 root root 849202 Dec 4 12:22 build.log
-rw-r--r-- 1 root root 51845204 Dec 4 12:22 trafficserver-debuginfo-8.0.8-11.3a53261.el7.x86_64.rpm
-rw-r--r-- 1 root root 7066360 Dec 4 12:22 trafficserver-8.0.8-11.3a53261.el7.x86_64.rpm
lrwxrwxrwx 1 zhoffm468 zhoffm468 60 Dec 4 12:13 dist -> /home/zhoffm468/go/src/github.com/apache/trafficcontrol/dist
Failed to build ats.
Results in 'dist':
total 58376
-rw-r--r-- 1 root root 849202 Dec 4 12:22 build.log
-rw-r--r-- 1 root root 51845204 Dec 4 12:22 trafficserver-debuginfo-8.0.8-11.3a53261.el7.x86_64.rpm
-rw-r--r-- 1 root root 7066360 Dec 4 12:22 trafficserver-8.0.8-11.3a53261.el7.x86_64.rpm
lrwxrwxrwx 1 zhoffm468 zhoffm468 60 Dec 4 12:13 dist -> /home/zhoffm468/go/src/github.com/apache/trafficcontrol/dist
```
All of our Docker builders use `clean_build.sh`, which set artifact ownership on exist:
https://github.com/apache/trafficcontrol/blob/ac0b3917a76fc9963599d8c72ca414e9fbaf9732/build/clean_build.sh#L22-L26
Ownership should be set within Docker so that root privileges is not a requirement for running `pkg`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r482312255
##########
File path: traffic_server/tsb/Dockerfile
##########
@@ -0,0 +1,75 @@
+# Licensed to the Apache Software Fou:qndation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+FROM centos:7
+
+RUN yum clean all \
+ && yum install -y deltarpm epel-release centos-release-scl-rh \
+ && yum-config-manager --enable rhel-server-rhscl-7-rpms \
+ && yum clean all \
+ && yum install -y \
+ autoconf \
+ automake \
+ pkgconfig \
+ libtool \
+ perl-ExtUtils-MakeMaker \
+ gcc-c++ \
+ glibc-devel \
+ tcl-devel \
+ expat-devel \
+ pcre \
+ pcre-devel \
+ libcap-devel \
+ flex \
+ hwloc-devel \
+ libuuid-devel \
+ lua-devel \
+ make \
+ git \
+ rpm-build \
+ man \
+ sudo \
+ python3 \
+ python35 \
+ ed \
+ zlib \
+ zlib-devel \
+ ncurses-devel \
+ libcurl-devel \
+ devtoolset-7 \
+ luajit-devel \
+ openssl \
+ openssl-devel \
+ hwloc \
+ perl-URI \
+ nmap-ncat \
+ perl-Digest-SHA \
+ nano \
+ ed \
+ && yum clean all
+
+ADD jansson.pic.patch /opt/src/
+ADD cjose.pic.patch /opt/src/
+ADD https://bootstrap.pypa.io/get-pip.py /
+RUN python get-pip.py
+RUN pip install --user Sphinx
+ADD run.sh /
+ADD trafficserver.spec /rpmbuilddir/SPECS/trafficserver.spec
+ADD traffic_server_jemalloc /rpmbuilddir/SOURCES/traffic_server_jemalloc
+RUN /usr/sbin/useradd -u 176 -r ats -s /sbin/nologin -d /
+CMD set -o pipefail; scl enable devtoolset-7 ./run.sh 2>&1 | tee /rpmbuilddir/RPMS/x86_64/build.log
Review comment:
`CMD set -o pipefail` fails with some base images (e.g., `debian`), so that command should follow the Dockerfile convention of using `&&`, not `;` (to catch `set -o pipefail` returning a nonzero exit code)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r536335335
##########
File path: pkg
##########
@@ -156,12 +175,28 @@ while (( "$#" )); do
if (( "$verbose" == 0 )); then
exec >/dev/null 2>&1
fi
+
+ # Build the project
if [[ $build_images -eq 1 ]]; then
"${COMPOSECMD[@]}" -f $COMPOSE_FILE build $1 || exit 1
else
"${COMPOSECMD[@]}" -f $COMPOSE_FILE pull $1 || exit 1
fi
"${COMPOSECMD[@]}" -f $COMPOSE_FILE run "${RUN_OPTIONS[@]}" --rm $1 || exit 1
+
+ # Check for a chained compose file for this particular project.
+ # A chained compose file will be named exactly the same as main docker-compose, with .service added,
+ # where <service> is the name of the specific service to be chained. The file may be a symlink to another
+ # compose file, in which case the symlink will be followed before it is processed.
+ # A "dist" symlink will be temporarily created in that directory to facilitate the collation of artefacts.
+ if [ -e "$COMPOSE_FILE.$1" ] ; then
+ ln -sf "$(dirname -- "$(realpath -e -- "$SELF")")/dist" "$(dirname -- "$(realpath -e -- "$COMPOSE_FILE.$1")")/dist" || exit 1
+ $SELF -f $(realpath -e "$COMPOSE_FILE.$1") $([ "$verbose" == 0 ] || echo "-v") $([ "$quiet" == 0 ] || echo "-q") $([ "$debug" == 0 ] || echo "-d") $([ "$build" == 0 ] || echo "-b") $("${COMPOSECMD[@]}" -f $(realpath -e "$COMPOSE_FILE.$1") config --services) || exit 1
+ rm "$(dirname -- "$(realpath -e -- "$COMPOSE_FILE.$1")")/dist"
Review comment:
The symlink is only removed if the build succeeds. It should be removed after building in all cases. One way to accomplish this is to wrap these lines in a subshell, then trap the `dist` symlink removal like
```shell
trap 'rm "$(dirname -- "$(realpath -e -- "$COMPOSE_FILE.$1")")/dist"' EXIT
```
so that `dist` is removed when the subshell exits.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] ezelkow1 commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
ezelkow1 commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r482270707
##########
File path: traffic_server/tsb/trafficserver.spec
##########
@@ -0,0 +1,151 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+%global src %{_topdir}/SOURCES/src
+%global git_args --git-dir="%{src}/.git" --work-tree="%{src}"
+%global tag %(git %{git_args} describe --long | sed 's/^\\\(.*\\\)-\\\([0-9]\\\+\\\)-g\\\([0-9a-f]\\\+\\\)$/\\\1/' | sed 's/-/_/')
+%global distance %(git %{git_args} describe --long | sed 's/^\\\(.*\\\)-\\\([0-9]\\\+\\\)-g\\\([0-9a-f]\\\+\\\)$/\\\2/')
+%global commit %(git %{git_args} describe --long | sed 's/^\\\(.*\\\)-\\\([0-9]\\\+\\\)-g\\\([0-9a-f]\\\+\\\)$/\\\3/')
+%global git_serial %(git %{git_args} rev-list HEAD | wc -l)
+%global install_prefix "/opt"
+%global api_stats "4096"
+%global _find_debuginfo_dwz_opts %{nil}
+
+Name: trafficserver
+Version: %{tag}
+Epoch: %{git_serial}
+Release: %{distance}.%{commit}%{?dist}
+Summary: Apache Traffic Server
+Vendor: Apache
+Group: Applications/Communications
+License: Apache License, Version 2.0
+URL: https://github.com/apache/trafficserver
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+Requires: tcl, hwloc, pcre, libcap
+BuildRequires: autoconf, automake, libtool, gcc-c++, glibc-devel, expat-devel, pcre, libcap-devel, pcre-devel, perl-ExtUtils-MakeMaker, tcl-devel, hwloc-devel
+Source: src
+
+%description
+Apache Traffic Server with Apache Traffic Control modifications and environment specific modifications
+
+%prep
+%setup -c -T
+cp -far %{src}/. .
+cp -far %{src}/../traffic_server_jemalloc ..
+autoreconf -vfi
+
+%build
+./configure --with-openssl=/opt/trafficserver/openssl --prefix=%{install_prefix}/%{name} --with-user=ats --with-group=ats --with-build-number=%{release} --enable-experimental-plugins --with-max-api-stats=%{api_stats} --disable-unwind
+make %{?_smp_mflags}
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/trafficserver/openssl/lib:/usr/local/lib
+make %{?_smp_mflags} check
+
+%install
+make DESTDIR=$RPM_BUILD_ROOT install
+
+mkdir -p $RPM_BUILD_ROOT/opt/trafficserver/etc/trafficserver/snapshots
+mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system
+cp rc/trafficserver.service $RPM_BUILD_ROOT/usr/lib/systemd/system/
+cp ../traffic_server_jemalloc $RPM_BUILD_ROOT/opt/trafficserver/bin/
+
+mkdir -p $RPM_BUILD_ROOT/opt/trafficserver/openssl
+cp -r /opt/trafficserver/openssl/lib $RPM_BUILD_ROOT/opt/trafficserver/openssl/lib
+
+mkdir -p $RPM_BUILD_ROOT/opt/trafficserver/lua
+cp -r /opt/build/luacrypto/src/.libs/crypto.so $RPM_BUILD_ROOT/opt/trafficserver/lua
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%pre
+id ats &>/dev/null || /usr/sbin/useradd -u 176 -r ats -s /sbin/nologin -d /
+
+%post
+/bin/systemctl daemon-reload
+/bin/systemctl enable trafficserver
+
+%preun
+/bin/systemctl stop trafficserver
+
+# if 0 uninstall, if 1 upgrade
+if [ "$1" = "0" ]; then
+ /bin/systemctl disable trafficserver
+fi
+
+%postun
+# Helpful in understanding order of operations in relation to install/uninstall/upgrade:
+# https://fedoraproject.org/wiki/Packaging:Scriptlets
+
+# Always do this because the service file may have been updated.
+/bin/systemctl daemon-reload
+
+# if 0 uninstall, if 1 upgrade
+if [ "$1" = "0" ]; then
+ id ats &>/dev/null && /usr/sbin/userdel ats
+fi
+
+%files
+%defattr(-,root,root)
+%attr(644,-,-) /usr/lib/systemd/system/trafficserver.service
+%dir /opt/trafficserver
+/opt/trafficserver/openssl
+/opt/trafficserver/lua
+/opt/trafficserver/bin
+/opt/trafficserver/include
+/opt/trafficserver/lib
+/opt/trafficserver/libexec
+/opt/trafficserver/share
+%dir /opt/trafficserver/var
+%attr(-,ats,ats) /opt/trafficserver/var/trafficserver
+%dir /opt/trafficserver/var/log
+%attr(-,ats,ats) /opt/trafficserver/var/log/trafficserver
+%dir /opt/trafficserver/etc
+%attr(-,ats,ats) %dir /opt/trafficserver/etc/trafficserver
+%attr(-,ats,ats) %dir /opt/trafficserver/etc/trafficserver/snapshots
+/opt/trafficserver/etc/trafficserver/body_factory
+/opt/trafficserver/etc/trafficserver/trafficserver-release
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/cache.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/hosting.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/ip_allow.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/logging.yaml
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/parent.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/plugin.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/records.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/remap.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/socks.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/splitdns.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/ssl_multicert.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/ssl_server_name.yaml
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/storage.config
+%config(noreplace) %attr(644,ats,ats) /opt/trafficserver/etc/trafficserver/volume.config
+
+%changelog
Review comment:
Do we want this full changelog in here, its fairly out of date anyway plus I might consider this going out to opensource to be a fresh start. Maybe cut it down to just a change with info for your initial release?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] alficles commented on a change in pull request #5004: Added transitive source build for ATS.
Posted by GitBox <gi...@apache.org>.
alficles commented on a change in pull request #5004:
URL: https://github.com/apache/trafficcontrol/pull/5004#discussion_r533727055
##########
File path: traffic_server/tsb/Dockerfile
##########
@@ -0,0 +1,75 @@
+# Licensed to the Apache Software Fou:qndation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+FROM centos:7
+
+RUN yum clean all \
+ && yum install -y deltarpm epel-release centos-release-scl-rh \
+ && yum-config-manager --enable rhel-server-rhscl-7-rpms \
+ && yum clean all \
+ && yum install -y \
+ autoconf \
+ automake \
+ pkgconfig \
+ libtool \
+ perl-ExtUtils-MakeMaker \
+ gcc-c++ \
+ glibc-devel \
+ tcl-devel \
+ expat-devel \
+ pcre \
+ pcre-devel \
+ libcap-devel \
+ flex \
+ hwloc-devel \
+ libuuid-devel \
+ lua-devel \
+ make \
+ git \
+ rpm-build \
+ man \
+ sudo \
+ python3 \
+ python35 \
+ ed \
+ zlib \
+ zlib-devel \
+ ncurses-devel \
+ libcurl-devel \
+ devtoolset-7 \
+ luajit-devel \
+ openssl \
+ openssl-devel \
+ hwloc \
+ perl-URI \
+ nmap-ncat \
+ perl-Digest-SHA \
+ nano \
+ ed \
+ && yum clean all
+
+ADD jansson.pic.patch /opt/src/
+ADD cjose.pic.patch /opt/src/
+ADD https://bootstrap.pypa.io/get-pip.py /
+RUN python get-pip.py
+RUN pip install --user Sphinx
+ADD run.sh /
+ADD trafficserver.spec /rpmbuilddir/SPECS/trafficserver.spec
+ADD traffic_server_jemalloc /rpmbuilddir/SOURCES/traffic_server_jemalloc
Review comment:
Done.
##########
File path: traffic_server/tsb/repos.yml
##########
@@ -0,0 +1,32 @@
+ats:
+ src: https://github.com/apache/trafficserver.git
+ branch: 8.0.x
+ head: a29528dffb8ea1c6fa57fe0c76ca1ec9d0f08694
+ extra:
+ - https://github.com/jrushford/trafficserver.git
+ - https://github.com/traeak/trafficserver.git
+cjose:
+ src: https://github.com/cisco/cjose
+ branch: master
+ head: 254ab05e04cc32d866712bea838990eb4011cbf5
+ extra: []
+jansson:
+ src: https://github.com/akheron/jansson
+ branch: master
+ head: aed855e6920923898b94a1b922fbace27a34ddf2
+ extra: []
+luacrypto:
+ src: https://github.com/mkottman/luacrypto.git
+ branch: master
+ head: 8c3f7f0caf023fe327f9e60391fc80df2d08a169
+ extra: []
+openssl:
+ src: https://github.com/openssl/openssl.git
+ branch: OpenSSL_1_1_1
+ head: 1708e3e85b4a86bae26860aa5d2913fc8eff6086
+ extra: []
+trafficcontrol:
+ src: https://github.com/apache/trafficcontrol
Review comment:
Done.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org