Follow the doccano-deploy.sh
script to deploy your resource.
We need to have an Azure Ressource Group and a running Posgres server in it.
It required the following env variables in your shell (fill the profile.sh
file from the profile.sh.template
).
- you choose the admin username, password and email for doccano
- ADMIN_USERNAME
- ADMIN_PASSWORD
- ADMIN_EMAIL
- you find the information about the existing resources
- SUBSCRIPTION_ID
- POSTGRES_SERVER_NAME (
az postgres server list --resource-group $RG_NAME | grep fullyQualifiedDomainName
, you also can parse it withjq
) - CREATION_POSTGRES_ADMIN_USERNAME
- POSTGRES_SERVER_PASSWORD
- DATABASE_NAME
- when you have deployed your doccano App Service, report the URL in the
profil.sh
Activate
source profile.sh
or
make activate
Launch a new panai retro game
make new-panai-retro
WIP Get answers
make get-retro-panai-answers
Unit testing
\n
make tests
make coverage
To handle the workload before a massive session :
On Azure portal/App Service resource : Scale-up
To reduce the bill amount between two sessions :
On Azure portal/App Service resource : Scale-up
Since the postgres database has firewall rules, we need to whitelist our App Service (doccano) resource. We need to do it again after a scale-up / scale-down because the machines are switched.
Get the outbound addresses of the App Service resource
And whitlist it in the postgreSQL database.
Either manually, or...
export OUTBOUND_IP_ADDRESSES=$(az webapp show --resource-group $RG_NAME --name $WEB_APP_NAME --query outboundIpAddresses --output tsv)
count=0
for i in $(echo $OUTBOUND_IP_ADDRESSES | tr "," "\n")
do
echo "$i\n"
az postgres server firewall-rule create --start-ip-address $i --end-ip-address $i --name doccano${count} --resource-group $RG_NAME --server-name qmpostgresql
let "count+=1"
echo "$count\n"
echo "doccano${count}"
done
TODO : if we terraform this infrastructure, this can be simplified.
In order to test if your application is well scaled and will handle the workload. You can do a stress test. The following test create 100 of simulataneous connections and use the admin account to annotate and un-annotate an image a 100 of times.
$ python stress_test.py
And follow the metric you want (response time for example) on Azure portal App Service resource/Monitoring.