Skip to content

Commit

Permalink
test log volume
Browse files Browse the repository at this point in the history
  • Loading branch information
vrbanecd committed Dec 19, 2024
1 parent c79439d commit 4230730
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ jobs:
credentials:
username: ${{ secrets.USERNAME }}
password: ${{ secrets.TOKEN }}
volumes:
- ./logs:/var/log/teapot'

steps:
- uses: actions/checkout@v4
with:
Expand Down
9 changes: 9 additions & 0 deletions .trunk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*out
*logs
*actions
*notifications
*tools
plugins
user_trunk.yaml
user.yaml
tmp
4 changes: 4 additions & 0 deletions .trunk/configs/.hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Following source doesn't work in most setups
ignored:
- SC1090
- SC1091
2 changes: 2 additions & 0 deletions .trunk/configs/.isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[settings]
profile=black
2 changes: 2 additions & 0 deletions .trunk/configs/.markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Prettier friendly markdownlint config (all formatting rules disabled)
extends: markdownlint/style/prettier
7 changes: 7 additions & 0 deletions .trunk/configs/.shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
enable=all
source-path=SCRIPTDIR
disable=SC2154

# If you're having issues with shellcheck following source, disable the errors via:
# disable=SC1090
# disable=SC1091
7 changes: 7 additions & 0 deletions .trunk/configs/.yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rules:
quoted-strings:
required: only-when-needed
extra-allowed: ["{|}"]
key-duplicates: {}
octal-values:
forbid-implicit-octal: true
5 changes: 5 additions & 0 deletions .trunk/configs/ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Generic, formatter-friendly config.
select = ["B", "D3", "E", "F"]

# Never enforce `E501` (line length violations). This should be handled by formatters.
ignore = ["E501"]
44 changes: 44 additions & 0 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This file controls the behavior of Trunk: https://docs.trunk.io/cli
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
version: 0.1
cli:
version: 1.22.8
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
plugins:
sources:
- id: trunk
ref: v1.6.6
uri: https://github.com/trunk-io/plugins
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
runtimes:
enabled:
- [email protected]
- [email protected]
- [email protected]
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
lint:
enabled:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- git-diff-check
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
actions:
disabled:
- trunk-announce
- trunk-check-pre-push
- trunk-fmt-pre-commit
enabled:
- trunk-upgrade-available
10 changes: 6 additions & 4 deletions config.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[Teapot]
# Here is the configuration for the Teapot server
APP_NAME=teapot
APP_NAME = teapot
# One less than the first port that is going to be used by any storm webdav
STARTING_PORT=32399
STARTING_PORT = 32399
# instance timeout, Storm-webdav instances are automatically deleted after a period of inactivity specified here
# default: 10 minutes
INSTANCE_TIMEOUT_SEC=600
INSTANCE_TIMEOUT_SEC = 600
# interval between instance timeout checks in stop_expired_instances
# default: 3 minutes
CHECK_INTERVAL_SEC=180
CHECK_INTERVAL_SEC = 180
# Hostname for the Teapot's uvicorn server (without the https:// part)
hostname = teapot
# Port number Teapot is listening on
Expand All @@ -23,6 +23,8 @@ Teapot_ssl_certificate = /var/lib/teapot/webdav/teapot.crt
Teapot_ssl_key = /var/lib/teapot/webdav/teapot.key
# Path to the Teapot log file location
log_location = /var/log/teapot/teapot.log
# Teapot's log level
log_level = INFO

[Storm-webdav]
# Here is the configuration for the Storm-Webdav server for each user
Expand Down
6 changes: 3 additions & 3 deletions teapot.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ async def lifespan(app: FastAPI):
flaat.set_trusted_OP_list(config["Teapot"]["trusted_OP"].split(", "))

# logging is important
LOGFILE = os.environ.get("TEAPOT_LOGFILE", config["Teapot"]["log_location"])
LOGLEVEL = os.environ.get("TEAPOT_LOGLEVEL", "INFO").upper()
logging.basicConfig(filename=LOGFILE, level=logging.getLevelName(LOGLEVEL))
LOGFILE = config["Teapot"]["log_location"]
LOGLEVEL = config["Teapot"]["log_level"]
logging.basicConfig(format='%(asctime)s %(message)s', filename=LOGFILE, level=logging.getLevelName(LOGLEVEL))
logger = logging.getLogger(__name__)

SESSION_STORE_PATH = os.environ.get(
Expand Down

1 comment on commit 4230730

@vrbanecd
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
32 0 0 32 100 18.131054999s

Passed Tests

Name ⏱️ Duration Suite
GET USER1 8.662 s Teapot-Tests
GET USER2 8.565 s Teapot-Tests
GET NO TOKEN 0.013 s Teapot-Tests
GET INVALID TOKEN 0.032 s Teapot-Tests
PUT REQUEST INVALID TOKEN 0.011 s Teapot-Tests
PUT REQUEST NO TOKEN 0.010 s Teapot-Tests
PUT REQUEST USER1 0.114 s Teapot-Tests
PUT REQUEST USER2 0.081 s Teapot-Tests
GET FILE USER1 0.064 s Teapot-Tests
GET FILE USER2 0.061 s Teapot-Tests
GET FILE NO TOKEN 0.009 s Teapot-Tests
GET FILE INVALID TOKEN 0.009 s Teapot-Tests
DELETE REQUEST USER1 0.037 s Teapot-Tests
DELETE REQUEST USER2 0.040 s Teapot-Tests
DELETE REQUEST INVALID TOKEN 0.009 s Teapot-Tests
DELETE REQUEST NO TOKEN 0.009 s Teapot-Tests
GET USER1 EXTRA_AREA 0.038 s Teapot-Tests
GET USER2 EXTRA_AREA 0.042 s Teapot-Tests
GET NO TOKEN EXTRA_AREA 0.010 s Teapot-Tests
GET INVALID TOKEN EXTRA_AREA 0.009 s Teapot-Tests
PUT REQUEST INVALID TOKEN EXTRA_AREA 0.009 s Teapot-Tests
PUT REQUEST NO TOKEN EXTRA_AREA 0.008 s Teapot-Tests
PUT REQUEST USER1 EXTRA_AREA 0.034 s Teapot-Tests
PUT REQUEST USER2 EXTRA_AREA 0.038 s Teapot-Tests
GET FILE USER1 EXTRA_AREA 0.051 s Teapot-Tests
GET FILE USER2 EXTRA_AREA 0.055 s Teapot-Tests
GET FILE NO TOKEN EXTRA_AREA 0.012 s Teapot-Tests
GET FILE INVALID TOKEN EXTRA_AREA 0.011 s Teapot-Tests
DELETE REQUEST USER1 EXTRA_AREA 0.035 s Teapot-Tests
DELETE REQUEST USER2 EXTRA_AREA 0.035 s Teapot-Tests
DELETE REQUEST INVALID TOKEN EXTRA_AREA 0.009 s Teapot-Tests
DELETE REQUEST NO TOKEN EXTRA_AREA 0.009 s Teapot-Tests

Please sign in to comment.