-
Notifications
You must be signed in to change notification settings - Fork 15
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
WIP: Add mirror creation script #2008
base: develop-v5.1.0
Are you sure you want to change the base?
Conversation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
Running this locally ❯ http localhost:7071/api/create-mirror address=https://github.com/JimMadge/dotfiles name=dotfiles username=jim password=password
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
Date: Wed, 10 Jul 2024 14:24:09 GMT
Server: Kestrel
Transfer-Encoding: chunked
Mirror successfully created And the function environment output
|
this looks like a good reference for setting up a function app using Pulumi. |
# Deploy app | ||
web.WebApp( | ||
f"{self._name}_web_app", | ||
enabled=True, | ||
https_only=True, | ||
kind="FunctionApp", | ||
location=props.location, | ||
name="giteamirror", | ||
resource_group_name=props.resource_group_name, | ||
server_farm_id=app_service_plan.id, | ||
site_config=web.SiteConfig( | ||
app_settings=[ | ||
{"name": "runtime", "value": "python"}, | ||
{"name": "FUNCTIONS_WORKER_RUNTIME", "value": "python"}, | ||
{"name": "WEBSITE_RUN_FROM_PACKAGE", "value": blob_url}, | ||
{"name": "FUNCTIONS_EXTENSION_VERSION", "value": "~4"}, | ||
], | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we prefer the gitea mirror to run as a webapp rather than an ACI? Is it cheaper/easier/better in some other way to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part isn't the Gitea instance, it is a webapp that uses the Gitea API to create/delete mirrors.
I am hoping that using the Azure Functions framework we can avoid the complication of managing flask/fastapi/etc. and use Entra ID authentication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless there is a reason not to, I think we should deploy all Gitea instances the same way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking that that now, there might be a fair bit of work to either generalise the Gitea configuration or make a new Pulumi ComponentResource.
I think we will want the mirror instance to be fairly different,
- No login
- Browseable without login
- No registration
- No LDAP authentication
Resources deploy. The webapp service is not able to fetch the app from storage though. Using the connection url + SAS token gives,
Possibly a problem with the construction of that string, or the way data is uploaded to storage. |
Although, |
The connection string was needed to fetch and unpack the Zip from blob storage. Now there seems to be some trouble identifying the endpoints, so I'm taking a step back and looking at examples to see what needs to be done. |
The problem was likely using the v2 Python programming model, where as examples use the v1 model. I couldn't find clear documentation on how to use the v2 model outside of deploying functions using Azure CLI, or examples of using the v2 model with Pulumi. Using the v1 model might be the most sensible thing for now. |
Following the v1 model directory structure means the functions get recognised and registered. |
✅ Checklist
Enable foobar integration
rather than515 foobar
).develop
.🚦 Depends on
Add Azure function apps to create read only mirrors in Gitea.
🌂 Related issues
Closes #1996
Related to #1997
🔬 Tests