Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,14 @@
&& apk add --no-cache --virtual .build-deps git g++ postgresql-dev yaml-dev \
&& apk add --no-cache libpq

WORKDIR /var/src/lnt
COPY . /var/src/lnt

COPY requirements*.txt setup.py .
# setup.py uses lnt.__version__ etc.
COPY lnt/__init__.py lnt/__init__.py
# we build the cperf extension during install
COPY lnt/testing/profile lnt/testing/profile
WORKDIR /var/src/lnt

RUN pip3 install -r requirements.server.txt \
&& apk --purge del .build-deps \
&& mkdir /var/log/lnt

COPY . .
COPY docker/docker-entrypoint.sh docker/wait_db /usr/local/bin/
Comment on lines +7 to 15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we remove the individual COPYs? This will cause unnecessary layers to be invalidated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if you just replace the original COPY requirements*.txt setup.py . with COPY requirements*.txt pyproject.toml . we should still be able to avoid reinstalling all the requirements on every build


VOLUME /var/log
Expand All @@ -25,4 +20,4 @@

ENV DB_ENGINE= DB_HOST= DB_USER= DB_PWD= DB_BASE=

ENTRYPOINT docker-entrypoint.sh

Check warning on line 23 in Dockerfile

View workflow job for this annotation

GitHub Actions / build

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for ENTRYPOINT to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/
34 changes: 19 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
LLVM "Nightly Test" Infrastructure
==================================
LNT: LLVM "Nightly Test" Infrastructure
=======================================

This directory and its subdirectories contain the LLVM nightly test
infrastructure. This is technically version "4.0" of the LLVM nightly test
architecture.
About
=====

The infrastructure has the following layout:
*LNT* is an infrastructure for performance testing. The software itself
consists of two main parts, a web application for accessing and visualizing
performance data, and command line utilities to allow users to generate and
submit test results to the server.

$ROOT/lnt - Top-level Python 'lnt' module
The package was originally written for use in testing LLVM compiler
technologies, but is designed to be usable for the performance testing of any
software.

$ROOT/lnt/server/db - Database schema, utilities, and examples of the LNT plist format.

$ROOT/docs - Sphinx documentation for LNT.
Documentation
=============

$ROOT/tests - Tests for the infrastructure.
The official *LNT* documentation is available online at:
https://llvm.org/docs/lnt

For more information, see the web documentation, or docs/.

Testing
=======
Source
======

Testing is done by running tox from the top-level directory. It runs the tests
for Python 3 and checks code style.
The *LNT* source is available in the llvm-lnt repository:
https://github.com/llvm/llvm-lnt
6 changes: 2 additions & 4 deletions docs/developer_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ To run the tests, we recomment using ``tox`` in a virtual environment::

You can also run individual unit tests with ``lit`` directly::

pip install lit
lit -sv ./tests

However, that requires manually setting up the testing environment (``filecheck``, etc).
pip install ".[dev]"
lit -sv tests

For simple changes, adding a regression test and making sure all regression
tests pass, is often a good enough testing approach. For some changes, the
Expand Down
2 changes: 0 additions & 2 deletions mypy.ini

This file was deleted.

154 changes: 154 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
[build-system]
requires = ["setuptools >= 74.1"]
build-backend = "setuptools.build_meta"

[project]
name = "LNT"
version = "0.4.2.dev0"
description = "LLVM Nightly Test Infrastructure"
readme = "README.md"
license = "LicenseRef-Apache-2.0-with-LLVM-exception"
license-files = ["LICENSE.TXT"]
authors = [
{ name = "Daniel Dunbar", email = "[email protected]" },
]
maintainers = []
keywords = ["web", "testing", "performance", "development", "llvm"]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
]
requires-python = ">=3.10"
dependencies = [
"aniso8601>=1.2.0",
"certifi",
"click>=8.1.0",
"Flask-RESTful>=0.3.10",
"Flask-WTF>=1.2.0",
"Flask>=3.1.0",
"Jinja2>=3.1.0",
"MarkupSafe>=3.0.0",
"python-gnupg>=0.3.7",
"pyyaml>=6.0.0",
"requests",
"SQLAlchemy==1.3.24",
"typing",
"Werkzeug>=3.1.0",
"WTForms>=3.2.0",
]

[project.urls]
Homepage = "https://llvm.org"
Documentation = "https://llvm.org/docs/lnt"
Repository = "https://github.com/llvm/llvm-lnt"
"Bug Reports" = "https://github.com/llvm/llvm-lnt/issues"

[project.scripts]
lnt = "lnt.lnttool:main"

[project.optional-dependencies]
server = [
"gunicorn>=19.9.0",
"psycopg2>=2.9.0",
]
dev = [
"filecheck",
"Flake8-pyproject",
"flake8",
"lit",
"tox",
]

[tool.setuptools]
ext-modules = [
{name = "lnt.testing.profile.cPerf", sources = ["lnt/testing/profile/cPerf.cpp"]}
]

[tool.setuptools.packages]
find = {namespaces = false}

[tool.setuptools.package-data]
"lnt.server.ui" = [
"static/*.ico",
"static/*.js",
"static/*.css",
"static/*.svg",
"static/bootstrap/css/*.css",
"static/bootstrap/js/*.js",
"static/bootstrap/img/*.png",
"static/flot/*.min.js",
"static/plotly/*.min.js",
"static/d3/*.min.js",
"static/jquery/**/*.min.js",
"templates/*.html",
"templates/reporting/*.html",
"templates/reporting/*.txt",
]
"lnt.server.db" = [
"migrations/*.py"
]

[tool.flake8]
ignore = ["E712", "E402", "E711", "E266", "W605", "E126", "E226", "W504"]
max-line-length = 120
count = true

[tool.mypy]
plugins = ["sqlmypy"]

[tool.tox]
env_list = ["py3", "mypy", "flake8", "docs"]

[tool.tox.env.py3]
description = "Run the unit tests"
allowlist_externals = ["rm", "lit"]
# TODO: Make it possible to run the tests without pinning down all dependencies
deps = [
"-r requirements.txt",
".[dev]",
]
commands = [
["rm", "-rf", "test_run_tmp"],
["lit", "-sv", "tests"],
]

[tool.tox.env.flake8]
description = "Run linter on the codebase"
deps = [".[dev]"]
commands = [["flake8", "--statistics", "--exclude=./lnt/external/", "./lnt/", "./tests/", "./deployment/"]]
skip_install = true

[tool.tox.env.mypy]
description = "Typecheck the codebase"
# TODO: Make it possible to install [.dev] dependencies instead
deps = [
"mypy >= 0.910",
"sqlalchemy-stubs",
"types-certifi",
"types-PyYAML",
]
# The option --no-incremental is currently needed to suppress warnings
# about UpdatedBase when running tests several times. Future versions of
# mypy should be checked to see if it can be removed and not get
# warnings after running tox several times.
commands = [["mypy", "--no-incremental", "--ignore-missing-imports", "lnt"]]
skip_install = true

[tool.tox.env.docs]
description = "Build the documentation"
deps = [
"sphinx==7",
"sphinx_bootstrap_theme",
]
allowlist_externals = ["make"]
commands = [["make", "-C", "{toxinidir}/docs/", "html"]]
skip_install = true
4 changes: 0 additions & 4 deletions setup.cfg

This file was deleted.

134 changes: 0 additions & 134 deletions setup.py

This file was deleted.

Loading