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

Self-service building (backend pieces) #39

Merged
merged 14 commits into from
Jan 29, 2024
Merged
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,21 @@ $ source spack/share/spack/setup-env.sh
```

To start the service, you will also need to configure a git repository to store
artifacts.
artifacts, and configure details of an LDAP server to query group information:

```yaml
artifacts:
repo: # see "integration tests" below

ldap:
server: "ldaps://ldap.example"
base: "ou=group,dc=example,dc=ac,dc=uk"
filter: "memberuid={user}"
group:
attr: "cn"
pattern: ".*"

```

### Stable release

Expand Down
97 changes: 92 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ types-setuptools = "^67.7.0.1"
types-PyYAML = "^6.0.12.9"
types-requests = "^2.30.0.0"
virtualenv = "^20.20.0"
watchfiles = "^0.21.0"

[tool.poetry.group.doc]
optional = true
Expand Down
25 changes: 0 additions & 25 deletions requirements.txt

This file was deleted.

6 changes: 5 additions & 1 deletion softpack_core/config/conf/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ server:
- http://localhost:3000
- http://localhost:5173

builder:
host: 0.0.0.0
port: 8001

artifacts:
repo:
url: https://github.com/mjkw31/softpack-artifacts
Expand All @@ -35,4 +39,4 @@ spack:
# filter:
# group:
# attr:
# pattern:
# pattern:
7 changes: 7 additions & 0 deletions softpack_core/config/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ class HeaderConfig(BaseModel):
port: int


class BuilderConfig(BaseModel):
"""Builder config model."""

host: str
port: int


class VaultConfig(BaseModel):
"""HashiCorp vault config."""

Expand Down
2 changes: 2 additions & 0 deletions softpack_core/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

from .models import (
ArtifactsConfig,
BuilderConfig,
LDAPConfig,
ServerConfig,
SpackConfig,
Expand All @@ -32,6 +33,7 @@ class Settings(BaseSettings):
ldap: Optional[LDAPConfig]
artifacts: ArtifactsConfig
spack: SpackConfig
builder: BuilderConfig

class Config:
"""Configuration loader."""
Expand Down
6 changes: 4 additions & 2 deletions softpack_core/graphql.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
from .app import app
from .schemas.base import BaseSchema
from .schemas.environment import EnvironmentSchema
from .schemas.groups import GroupsSchema
from .schemas.package_collection import PackageCollectionSchema


class GraphQL(API):
"""GraphQL API."""

prefix = "/graphql"
schemas = [EnvironmentSchema, PackageCollectionSchema]
schemas = [EnvironmentSchema, PackageCollectionSchema, GroupsSchema]
commands = Typer(help="GraphQL commands.")

@staticmethod
Expand Down Expand Up @@ -126,4 +127,5 @@ def __init__(self, schema: strawberry.Schema, prefix: str) -> None:
"""
super().__init__(schema=schema, path=prefix)

router = Router(schema=Schema(schemas), prefix=prefix)
schema = Schema(schemas)
router = Router(schema=schema, prefix=prefix)
Loading
Loading