Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimap API v0.1 - Initial release #148

Merged
merged 20 commits into from
Jul 21, 2023
Merged

Minimap API v0.1 - Initial release #148

merged 20 commits into from
Jul 21, 2023

Commits on Jul 1, 2023

  1. Optimize Player Full Karma querying and update DTO

    The method for querying a player's full karma has been optimized by compiling the EF query. Compiling the query improves the performance as it removes the overhead of query compilation at runtime. This change ensures that the application is more performant and responsive to the end user.
    
    Moreover, the AccountFullKarmaDTO model was updated to better reflect the structure of the Karma system, enhancing readability and maintainability of the code.
    
    Signed-off-by: Sakura Akeno Isayeki <[email protected]>
    SakuraIsayeki committed Jul 1, 2023
    Configuration menu
    Copy the full SHA
    d661be0 View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2023

  1. Configuration menu
    Copy the full SHA
    149a431 View commit details
    Browse the repository at this point in the history
  2. ci: Add CI workflow for Minimap API

    This commit adds a new GitHub Actions workflow file, `minimap-main.yml`, which sets up continuous integration (CI) for the Minimap API. The workflow is triggered on push or pull request events for the main or develop branches. It also allows manual execution from the Actions tab.
    
    The workflow consists of two jobs:
    1. "linter" job runs linter checks using Python 3.10 on Ubuntu latest.
    2. "tests_linux" job installs project dependencies and runs tests on Ubuntu latest.
    3. "tests_win" job installs Pip, then installs and tests the project on Windows latest.
    
    These changes ensure that code quality is maintained and tests are run automatically during development.
    SakuraIsayeki committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    1786888 View commit details
    Browse the repository at this point in the history
  3. refactor: Change project file structure

    The commit renames several files and directories in the project to adhere to a new naming convention. The changes include renaming the project directory, source files, configuration files, and documentation files. This refactor improves consistency and readability of the codebase.
    SakuraIsayeki committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    1c03fae View commit details
    Browse the repository at this point in the history
  4. feat: Update docker-compose and app configuration

    - Updated the `docker-compose.yaml` file to use environment variables with a new prefix for dynamic configuration.
    - Modified the `app.py` file to change the title of the FastAPI application.
    
    This commit improves the configuration and naming conventions in the project.
    SakuraIsayeki committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    fa5668a View commit details
    Browse the repository at this point in the history
  5. feat: Update app description and security

    - Updated the description of the app in the FastAPI configuration.
    - Changed the algorithm used for security from HS256 to HS384.
    SakuraIsayeki committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    a6fc27d View commit details
    Browse the repository at this point in the history
  6. feat(routes): Remove content routes & update user creation functionality

    This commit removes the content routes from the application and adds functionality to create new users. The `content.py` file has been deleted, along with its associated model classes and route handlers. The `user.py` file now includes a new route handler for creating users, which checks if the username already exists and only allows superusers to create other superuser accounts. Additionally, if this is the first user being created in the database, they are automatically assigned as a superuser.
    
    The changes made in this commit simplify the codebase by removing unused functionality and enhance user management capabilities by allowing for easy creation of new accounts.
    SakuraIsayeki committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    30f7145 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2023

  1. feat(render): Add render route for replay rendering

    - Added a new route `/render` in the `render.py` file to handle replay rendering.
    - The route accepts a replay file and an optional replay ID.
    - Checks if the uploaded file is a valid replay file with the `.wowsreplay` extension.
    - Validates the size of the uploaded file against the maximum allowed size defined in the configuration.
    - Writes the replay data to a temporary file in `/tmp/wows-karma/minimap/`.
    - Uses the `Renderer` class from `renderer.render` module to start rendering based on provided options (enable chat, team tracers).
    - Returns the rendered video file as a response with media type "video/mp4" and filename based on either provided or default replay ID.
    SakuraIsayeki committed Jul 20, 2023
    Configuration menu
    Copy the full SHA
    170c135 View commit details
    Browse the repository at this point in the history
  2. feat(render): Update requirements and add target player ID support

    - Updated the `requirements.txt` file to use an in-house repository for the minimap renderer.
    - Added support for specifying a target player ID in the `render_replay` function.
    SakuraIsayeki committed Jul 20, 2023
    Configuration menu
    Copy the full SHA
    fb5e850 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    20bc0ef View commit details
    Browse the repository at this point in the history
  4. fix(ci): Update python-version matrix in minimap-main.yml

    The python-version matrix in the minimap-main.yml file has been updated to use the string representation of the Python version "3.10" instead of the previous array representation [3.10]. This change ensures compatibility with the CI workflow configuration.
    SakuraIsayeki committed Jul 20, 2023
    Configuration menu
    Copy the full SHA
    65e95d1 View commit details
    Browse the repository at this point in the history
  5. fix(ci): Update directory name in minimap-main.yml

    The commit updates the directory name from "wowskarma.api.minimap" to "wowskarma_api_minimap" in the minimap-main.yml file. This change ensures consistency and improves readability.
    SakuraIsayeki committed Jul 20, 2023
    Configuration menu
    Copy the full SHA
    b26ea12 View commit details
    Browse the repository at this point in the history
  6. ci: Add Docker build and push workflows for Minimap API

    - Added a new workflow file `minimap-api-build.yml` to build the Minimap API Docker image.
    - Added a new workflow file `minimap-api-push.yml` to push the Minimap API Docker image to DockerHub and GHCR.
    - Deleted the old workflow file `minimap-main.yml` which was used for CI testing.
    
    These changes enable automated building and pushing of the Minimap API Docker image.
    SakuraIsayeki committed Jul 20, 2023
    Configuration menu
    Copy the full SHA
    a2f1df6 View commit details
    Browse the repository at this point in the history
  7. ci: Refactor Minimap API build and push workflows

    - Removed unnecessary path restriction in the build workflow
    - Updated DockerHub login action to v2
    - Added setup for QEMU and Docker Buildx in the build workflow
    - Replaced GHCR login action with DockerHub login action in the push workflow
    - Modified push step to use docker/build-push-action@v4 for building and pushing images with updated tags
    SakuraIsayeki committed Jul 20, 2023
    Configuration menu
    Copy the full SHA
    310e512 View commit details
    Browse the repository at this point in the history
  8. feat(minimap_api_security): Improve get_current_user function

    The `get_current_user` function in the `security.py` file has been improved. The `fresh` parameter has been removed from the function signature, as it was not being used. Additionally, a commented out block of code that raised a credentials exception based on the freshness of the token and user's superuser status has been temporarily disabled.
    SakuraIsayeki committed Jul 20, 2023
    Configuration menu
    Copy the full SHA
    bd9b553 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2023

  1. feat(render): Add background task for removing temporary file

    This commit adds a new parameter `background_tasks` to the `render_replay` function in the `render.py` file. The purpose of this parameter is to allow for the addition of a background task that removes the temporary file after it has been rendered and returned as a response. This helps to clean up any leftover files and improve overall system efficiency.
    SakuraIsayeki committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    90b3e5a View commit details
    Browse the repository at this point in the history
  2. feat(cli): Remove unused import and variable

    The commit removes an unused import and variable in the `cli.py` file. The import for `Content` from the models module is removed, as it is not being used in the code.
    
    fix(config): Add temporary work directory for replay processing
    
    This commit adds a new configuration option to the `default.toml` file. The `temp_workdir` setting specifies the temporary directory path for replay processing. The default value is set to "/tmp/wowskarma/minimap".
    
    refactor(routes): Update filepath handling in render_replay function
    
    In this commit, the filepath handling in the `render_replay` function of the `render.py` file is updated. Instead of using a hardcoded path, it now uses the configured temporary work directory from settings. Additionally, pathlib.Path is used to concatenate filepaths and ensure platform compatibility.
    SakuraIsayeki committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    192acb1 View commit details
    Browse the repository at this point in the history
  3. feat(render): Add logging for new render job

    This commit adds logging functionality to the render_replay function in the `render.py` file. Now, when a new render job is started, a log message will be generated with details such as the Job ID, Replay ID (if available), and Filename. This helps in tracking and monitoring render jobs.
    
    Additionally, the commit also updates the filepath generation logic to use the newly generated Job ID instead of generating a random filename each time. This improves consistency and makes it easier to identify rendered files.
    
    The rendering process has also been updated to include quality settings (quality=9) and frame rate settings (fps=30) for better output results.
    
    Closes #123
    SakuraIsayeki committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    52ded6b View commit details
    Browse the repository at this point in the history
  4. feat(render): Add fps and quality options to replay rendering

    - Added `fps` option to control the frames per second for replay processing.
    - Added `quality` option to specify the quality of the output video.
    - Updated temporary work directory path for replay processing.
    SakuraIsayeki committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    8b0bef4 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2dca693 View commit details
    Browse the repository at this point in the history