instructlab / instructlab-bot

GitHub bot to assist with the taxonomy contribution workflow
Apache License 2.0
12 stars 15 forks source link

GITHUB_TOKEN and GITHUB_USER passable via env worker + bot #364

Closed Gregory-Pereira closed 1 month ago

Gregory-Pereira commented 1 month ago

WIP Until confirming that it works via testing.

Gregory-Pereira commented 1 month ago

Tested extensively. Everything works as intended with 1 small exception falling short of my envisioned outcome.

After initial tests and much confusion I soon realized the --build-args I was passing to the build command:

docker build --build-arg GITHUB_USER=Gregory-Pereira --build-arg GITHUB_TOKEN=... -t ghcr.io/instructlab/instructlab-bot/instructlab-serve:testing-greg . -f worker/Containerfile

did nothing at all.

I was hoping to be able to build from --build-arg GITHUB_USER=Gregory-Pereira --build-arg GITHUB_TOKEN=..., in my command to build the worker image, however after quite literally a full day of slamming my face against it no dice. In any case, this now supports env values, and with the --github-token directive on the worker run command overriding the .env values present. You can run generate with or without the directive, ex:

export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
export AWS_DEFAULT_REGION= <some_aws_region>
instructlab-bot-worker generate \
  --redis redis:6379  \
  --s3-bucket <someones_s3_bucket> \
  --precheck-endpoint-url <mysterious_endpoint> \
  --aws-region <some_aws_region> \
  --sdg-endpoint-url <mysterious_other_endpoint> \
  --tls-insecure

and precheck lands fine, in either case. RFR.