Commit Graph

67 Commits

Author SHA1 Message Date
James E. Blair 25d5cda146 Publish container images to quay.io
Change-Id: I32010b0baa4135e2d710dbcaff71ffa1d3ba509b
2023-04-21 10:06:29 -07:00
Clark Boylan ae8090ef4a Use bullseye instead of buster
It occurred to me after we landed the switch to buster that the old
testing would've been closer to bullseye. I suspect that now that
bullseye has released testing has moved ahead of that and that is what
broke things. Anyway lets use bullseye instead as it is newer and more
up to date.

Change-Id: I2b405c4e3cd6c7d06d79875f540262ebba788336
2021-10-14 16:22:53 -07:00
James E. Blair ab9115d4f9 Switch base image to debian buster
This is probably what "testing" was the last time we build this
anyway.  Current "testing" doesn't work with bindep.

Change-Id: I475f782e6516a5854cb7fc54c07200ef1e20a7fc
2021-10-14 13:33:19 -07:00
Monty Taylor a2fd4212ba Remove libboost-system depends
We don't need them. We do for building, but the
transitive depend from libcpprest takes care of
it for us. We don't need libboost-system for
runtime at all.

Change-Id: Ife9af152d14da238ef7ce2b72e9ac1d766663da5
2020-07-15 13:34:14 -05:00
Monty Taylor 0a58af807b Bump to c++17 and switch boost::optional to std::optional
We have access to c++17, so use it. As a result, replace
boost::optional with std::optional.

Change-Id: Iba59bfd516264e817f2da14ded47d4d63a37e399
2020-07-15 12:03:25 -05:00
Monty Taylor f19e38dab5 Simplify build
We only compile for a single platform, the one inside our container.
Since we do that, we can massively simplify this build.

Change-Id: Ic7d088fd85f2cf88838cb83524aaf1c8b2e858bf
2020-07-15 12:03:05 -05:00
Zuul e0a596bf15 Merge "Handle SSL proxying and other fixes" 2020-04-08 17:11:47 +00:00
James E. Blair 26d88125ef Handle SSL proxying and other fixes
Enable mod_ssl and enable proxying to ssl-terminated endpoints.

In the case where the artifact is not found, return NULL instead
of the bogus "Artifact_not_found" url, otherwise we can end up in
a loop where we continuously append that to the url.

Strip trailing slashes from the returned proxy target.  We can't
guarantee that folks won't have a '/' at the end of the artifact
url they return to Zuul (and in fact, it's probably more correct
that they do).  But our regex in mod_rewrite guarantees that we
will add a slash to it.  One sure way to handle this is just to
strip it from the data returned from Zuul if present.

Add a .dockerignore file with both itself and the Dockerfile
added, so that docker won't rebuild extra layers (like the C++
compile layer) if we just change the Dockerfile.

Change-Id: I00dfd0b6842abedf938702a816698d1c6526974d
2020-04-08 09:50:29 -07:00
Monty Taylor dd2610207b Check to make sure artifact has a url
Before we fetch it, it needs to exist, otherwise we core-dump.

Change-Id: I086a706c70807bc547b286b0f587a27f9f19d38e
2020-04-07 13:28:04 -05:00
James E. Blair e0d10c611e Look up artifacts by metadata.type rather than name
So that we can have nice looking names like "Preview Site", find
the artifact by looking up the 'type' field in metadata.

Change-Id: Ia01e95c77f068bd8ab3a515aa023c1f79332fc67
2020-04-07 08:34:55 -07:00
James E. Blair faeda1ab85 Don't proxy urls that don't appear in the map
If a rewritemap fails to find a URL, mod_rewrite will nonetheless
continue to attempt to proxy the request; if the request has a
hostname in the URI (as it would if it were being used as a forward
proxy), then it will proxy to that URI.  The upshot is that this
was behaving as an open proxy for any URL that it didn't know about.

Correct this by "proxying" to http://localhost/notfound in all cases
where the map program fails, and then cause that URL to always fail
with a 403.

This seems a little Rube Goldberg, but I don't see another way to
deal with map failures in a rewriterule proxy.

Change-Id: I1fdace79b6059c0297dd27b6bc9ce0afa9fe1396
2020-04-06 15:02:40 -07:00
Zuul 6f9af44049 Merge "Use splice instead of erase/push_front" 2019-04-22 13:09:43 +00:00
OpenDev Sysadmins 7aa4009be7 OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:25:32 +00:00
Monty Taylor e55490b8b4 Use splice instead of erase/push_front
splice inserts an item into one container removing it from another
container. It seems to be what people use for this usecase in STL
LRU implementations.

Change-Id: I038aea2e3aadfce01ca30946c16fea3ce0b17b4f
2019-04-12 20:45:44 +00:00
Jakub Bielecki 986ea056a9 add basic description into README.rst
No code changes, documentation only.

It's unknown what this project is about, so adding a basic example.
I've obtained it only by quickly reverse-engineering main.cc, so please
make sure I've got this correctly(/-ish).

Change-Id: I0976243d363ee6dcb55bd93132b731a65a9734f7
2019-03-11 12:41:10 +01:00
James E. Blair 4db7857bc5 Return NULL on all errors
This is what the mod_rewrite documentation says we should return
if we are unable to map the URL.

Change-Id: Ifec0a5eb6076e36eb32bb67e0eca6ea4df3a7b13
2019-03-05 08:44:46 -08:00
James E. Blair f5121119c8 Use artifact name rather than log_url
So that we can return the preview URL as the success url, use the
artifact name to look up the forward URL.

Change-Id: I8d67e1527d8f911579779a9a036a3c7f5c79a27f
2019-03-01 12:43:13 -08:00
James E. Blair f6c78a3605 Build docker image
This adds a job which builds the Dockerfile; it inherits from a
job which uses a buildset registry.

Change-Id: If7789d7bf969b3566dc55343aa1cf0761b96d7b3
2019-02-22 10:39:06 -08:00
Monty Taylor ba35b4f24b Update gitreview file with correct project name
And add initial .zuul.yaml

Change-Id: Idb8ac05aaee2fd55b2bbd38ff9989253ecc64944
2019-02-14 11:55:49 -08:00
James E. Blair 756f274a17 Remove .zuul.yaml for import 2019-02-11 17:44:44 -08:00
Monty Taylor 84a247d43e Add a cache for client objects
Rather than creating them in the loop for each, make one client
object per api url.
2019-02-11 21:16:13 +00:00
Monty Taylor a4c1ce615a Remove stray " 2019-02-11 18:52:29 +00:00
Monty Taylor 5b57763831 Remove ax_cxx_check_lib and use autoconf-archive
We don't need this local lib check macro. We can use AX_CHECK_LIBRARY
from autoconf-archive.
2019-02-11 18:35:15 +00:00
Monty Taylor d78f94457f Use debian:testing-minimal base image 2019-02-11 18:26:42 +00:00
James E. Blair 7b680c18ec Use an env var for the API url 2019-02-11 08:39:01 -08:00
James E. Blair 12e8291698 Clean up comments 2019-02-11 07:47:26 -08:00
Monty Taylor 5a36c4a3eb Use boost::optional and drop std back to 14
boost::optional works on stretch and doesn't add any depends. The
c++17 support in gcc isn't complete anyway.
2019-02-11 15:27:50 +00:00
James E. Blair aa1cd8ed1c Merge branch 'master' of github.com:emonty/upgraded-octo-giggle 2019-02-11 07:25:07 -08:00
James E. Blair 07cd0862de Set cache size to 1024
And tweak the rewrite url.
2019-02-11 07:24:41 -08:00
Monty Taylor b4c96c2094 Use bool cast for testing optional<> value
We don't need the call to has_value, we can do it in the if directly.
2019-02-11 15:21:54 +00:00
Monty Taylor f463a6c794 Revert "Use uniform initializer syntax everywhere"
This reverts commit 49b41704e0.
2019-02-11 15:18:29 +00:00
Monty Taylor 49b41704e0 Use uniform initializer syntax everywhere 2019-02-11 14:53:57 +00:00
Monty Taylor 7c55682e08 Use autoconf archive for boost and openssl 2019-02-11 14:53:57 +00:00
James E. Blair 9b9951dff5 Run apache
Add an apache vhost config file which uses zuul-preview as a
rewritemap.

Remove extraneous output from zuul-preview.

Add an exception handler around the http code.

Remove the mutex (as we are single threaded).

Run apache as the docker CMD.
2019-02-10 17:33:27 -08:00
Monty Taylor 8dc7bfcf16 Add mutex to gets and puts
gets and puts both mutate the underling structures. Put in a mutex
and use a guard to make sure we're not stepping on ourselves.

This almost certainly could be smarter.
2019-02-10 19:25:30 +00:00
Monty Taylor c9245f61ec Add consts to LRU and use std::optional
c++17 (which our compiler supports) has std::optional<T> that can
be used for thigns that return a value or nothing (like this) Use
that.

add in some consts and pass parameters by const reference.

use std::uint32_t instead of uint. Initialize it with the constructor
initializer list instead of in the body of the constructor, and use
uniform initialization syntax to do so.

Initialize the cache instantiation using uniform initialization.

Use a few more autos so that we don't have to type const as much.
2019-02-10 19:17:38 +00:00
Monty Taylor 80d56bccb3 Re-add -Werror
Accidentally lost this in the autoconf refactor.
2019-02-10 19:15:51 +00:00
Monty Taylor fc1a31230e Remove cruft from Makefile.am
We don't really need the maintainer-clean thing - we've got git for
that. But also, add README.rst and bindep.txt to EXTRA_DIST.
2019-02-10 19:15:50 +00:00
Monty Taylor d60536e3f2 Remove bootstrap.sh
This isn't really needed. It's autoreconf -fi, which is what the
README already lists. Just run that.
2019-02-10 19:15:50 +00:00
Monty Taylor ea86004180 Remove libtoolize related cruft 2019-02-10 19:15:50 +00:00
James E. Blair 428a10df1f Add comments to LRU cache class 2019-02-10 10:09:08 -08:00
James E. Blair a5f2e26095 Add LRU cache 2019-02-10 10:04:44 -08:00
Monty Taylor 31d726c6e6 Overhaul warnings, debug and optimize settings
There's a ton of stuff in here that's holdovers from the days of
Drizzle, such as intel c compiler and solaris support, that can
just flat go away. There's also support for being able to turn off
a bunch of various things with m4 parameters that were there to let
us deal with legacy MySQL code. We don't need any of those. We can
also just depend on autoconf archive for more functions and align
with the behavior there rather than carrying local logic.

While we're at it, rename both pandora and zuul prefixed things to
opendev. pandora-build is what we were calling the collection of
autoconf stuff 10 years ago, but is a long-dead project. That said,
none of this is specific to zuul, but might still be useful for
general C++ "I want to build things cleanly and stricly like
Drizzle did". Use opendev for now, with the thought that perhaps
we'll extract these into their own repo to be used by people
should they choose.

Perhaps a better prefix choice would be "DRIZZLE_" - since these
are "build things inspired by Drizzle" - but maybe that implies
a provenance that doesn't exist.

Update copyright for the files that have essentially been rewritten.
For the ones that are still legitimately based on the original code,
add a Red Hat header line.
2019-02-10 17:31:33 +00:00
Monty Taylor b1063b17e0 Remove vendored copies of m4 files
These can be consumed directly via gnulib and autoconf-archive
packages these days. (yay!) Remove the copies from the tree and
add gnulib and autoconf-archive to bindep.

As part of doing this, switch to using the autoconf-archive version
of debug flag handling, AX_CHECK_ENABLE_DEBUG.
2019-02-10 15:31:12 +00:00
Monty Taylor bab23a5e9b Add Dockerfile 2019-02-10 14:45:53 +00:00
Monty Taylor b89f989055 Pass input string by const reference
We're not mutating the string, so it can be const. And we can pass
by reference instead of by value to avoid the copy.
2019-02-09 21:51:43 +00:00
Monty Taylor 5302413002 Get rid of -Wmissing-declaration
The extra line just looks weird.
2019-02-09 21:48:47 +00:00
Monty Taylor d58179dba7 Strip more autoconf stuff we don't need
We're not building on solaris.
2019-02-09 21:39:17 +00:00
Monty Taylor 2cabe5501c Simplify library searching
Use AX_CXX_CHECK_LIB from autoconf archive instead of
AC_LIB_HAVE_LINKFLAGS which is from gettext and causes a bunch of
other stuff to need to be copied in.
2019-02-09 21:39:17 +00:00
Monty Taylor 3d97c9fc7a Use libtool automake variables 2019-02-09 21:39:17 +00:00