I’ve created a cloudformation template for AWS. It is now only for eu-west-1 region (Ireland) and I would like to extend it for all regions. For this I woud like a little help from people who would like to test it in other regions and send me the best matching AMI ids, so I can extend the template and make it more universal. For the eu-west-1 region I use ubuntu with preinstalled docker and docker-compose image, which is availably in community images. The stack takes about 7 min to full deploy, the most time takes booting the EC2 machine which fetch Docker images from the hub.docker.com. Anyone interested please check the link
Unfortunately this work was expunged from the main openremote repo. Nevertheless, it was a part of a bigger project of mine which is well and still alive. I’ve just run it and indeed it is deploying complete stack in few minutes. The project is called openremote-cli and it encapsulates the CF template itself. As i can see it is running Amazon Linux now and is fetching most recent AMI via SSM Parameter Store. Therefore it should be OK to deploy in any region out of the box.
Saying all that, I’m not doing any vanilla CloudFormation deployments anymore. In my work I’m focused on AWS CDK, which is much more powerful. Perhaps if there is interest from community I might release the latest tooling update, which contains CDKPipeline, which is quite nice self-mutating pipeline all in code. It is much more sophisticated than any static pipelines as offered by GitHub actions.
ok … I’ve had a look at or-cli guide and I’m a little confused (complete newbie!) …
my present setup is that I’ve installed OR on my win10 laptop running docker desktop and all is aok and having fun trying out the various cool features …
Windows is unfortunately not my strongest part. Anyway installation seems to be without errors so I’m thinking that PATH isn’t set correctly. On macOS you can run following:
> which openremote-cli
/usr/local/bin/openremote-cli
Of course you can use -v or even -vvv parameters to get more feedback. Anyway, you are deploying through docker but haven’t configured any port forwarding (-p docker options). However, as this script is quite old (15 months when I check), I’m 100% sure that it works anymore for local deployment. I’m using it mostly for AWS deployment, which is still functional. Nevertheless, my advise here would try to run without docker (or add -p or -host networking options to docker). Without docker it deploys correctly on my machine:
> openremote-cli deploy -v
If you need help go to https://forum.openremote.io/
Deploying OR... This usually takes less than 15 minutes.
> docker swarm init
> docker volume rm openremote_postgresql-data
> wget -nc https://github.com/openremote/openremote-cli/raw/main/cloudformation/mvp-docker-compose.yml
100% [................................................................................] 3539 / 3539> DOMAINNAME=localhost IDENTITY_NETWORK_HOST=localhost docker-compose -f mvp-docker-compose.yml -p openremote up -d
Stack deployed, waiting for startup to complete .......👍
Open https://localhost and login with admin:secret
Remove the stack when you are done:
> docker-compose -f mvp-docker-compose.yml -p openremote down
> rm mvp-docker-compose.yml
To remove docker resources:
> docker images --filter 'reference=openremote/*' -q | xargs docker rmi
> docker volume ls --filter 'dangling=true' -q | xargs docker volume rm
Yes, this is because in the script I’m using Linux environment variables for settings. What you can do is to run it with -v switch, which will expose all commands which CLI uses internally and you can convert it to correct Windows equivalent. Command which fails in your example is: DOMAINNAME=localhost ... docker-compose ... up, which is in fact just docker-compose with env settings.
Of course you can run it through wsl without these issues. Maybe users more experienced with Windows than me can jump in @Don ?
OK, so the command for Windows should be changed to
set DOMAINNAME=localhost; set IDENTITY_NETWORK_HOST=localhost; docker-compose -f mvp-docker-compose.yml -p openremote up -d
I’ve tried it and it runs correctly, however I doubt that I’ll find resources to update openremote-cli tool for the Windows case. I’m using this tool mainly on cloud Linux machines to deploy whole stack with a single command.
What I would suggest on Windows is run or deploy -v --dry-run and see all required commands. I’m using this when I’m not using the stack for a while and forget related commands (I’m only human and forgetting not used stuff pretty fast )
or deploy -v --dry-run
--dry-run active!
If you need help go to https://forum.openremote.io/
Deploying OR... This usually takes less than 15 minutes.
> docker swarm init
> docker volume rm openremote_postgresql-data
> wget -nc https://github.com/openremote/openremote-cli/raw/main/cloudformation/mvp-docker-compose.yml
> DOMAINNAME=localhost IDENTITY_NETWORK_HOST=localhost docker-compose -f mvp-docker-compose.yml -p openremote up -d
Open https://localhost and login with admin:secret
Remove the stack when you are done:
> docker-compose -f mvp-docker-compose.yml -p openremote down
> rm mvp-docker-compose.yml
To remove docker resources:
> docker images --filter 'reference=openremote/*' -q | xargs docker rmi
> docker volume ls --filter 'dangling=true' -q | xargs docker volume rm
which uses aws-cli under the hood. I assume that you have route53 hostedzone for domain already. Also, you would need a keypair openremote and profile openremote-cli. Test it with --dry-run
This is profile for aws-cli which openremote-cli is using under the hood. You should create IAM user which you will be using for deploying the stack. Then you need create credentials for programatic access, i.e. id and secret. Then you can run either aws configure --profile openremote-cli or openremote-cli configure_aws which will do the same.
When I look on Access Advisor of such user I see that following services are used: IAM, CloudFormation, CloudWatch, EC2, Route53, SNS, SSM, KMS, S3 and ECR. You can check yourself which policies you need by looking at Access Advisor. For different openremote-cli commands different services are needed.