-
Notifications
You must be signed in to change notification settings - Fork 78
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
Configuration to work with GitHub Codespaces #3493
base: integration
Are you sure you want to change the base?
Configuration to work with GitHub Codespaces #3493
Conversation
Hello, wondering if you could provide any more context about this? Thanks! |
Of course. In our institute (Łukasiewicz Institute of Aviation) there are two reasons for which this helps a lot:
Why this is needed?
With this PullRequest difficulty level for running/developing LiteFarm is much lower. To work with LiteFarm with GitHub Codespaces you need only:
|
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.
Thank you for the contribution, this is a really cool idea! I added a comment and a couple of questions
"language": "en" | ||
}, | ||
{ | ||
"filename": "packages/api/src/jobs/locales/pl/*.*", |
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 probably comes from your organization's specific setup, but we don't currently support pl locale -- could we remove references to this? Actually, I'm thinking it might be better to remove the extensions from this file altogether, since we don't currently have a unified criteria on extensions to use as a team and it's up to each developer to use the tools they deem necessary
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.
Yes and no. We were working on polish translation to LiteFarm and it is almost done: https://github.com/Lukasiewicz-Instytut-Lotnictwa/LiteFarm/tree/feature/GL-4-polish-translation.
Expect a pull request soon. But of course this is not important. It just helps to find spelling errors in translation files when working with Visual Studio Code.
if [ -x "$(command -v docker-compose)" ]; then | ||
docker-compose up --detach | ||
else | ||
docker compose up --detach | ||
fi |
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.
Could you please explain what this block should be doing? It seems it does the same in both cases of the condition
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.
In my computer (Debian Bookworm) there is command docker-compose
and when I try to run docker compose
(without -
) then I have an error:
$ docker compose
docker: 'compose' is not a docker command.
On the other hand in GitHub Codespaces there is command docker compose
.
Command docker-compose
is the old docker script command and as I know it is not maintained anymore but exists on some systems (like mine Debian).
Command docker compose
is the new docker script and should be use.
In summary this is only for backward compatibility.
I use this script to start development on my local computer (it works not only in GitHub Codespaces).
Of course it can be removed in favour of the new version docker compose
.
(I'm not sure why Debian Bookworm has such old version of Docker - 20.10
vs current 27
.)
if [ -x "$(command -v docker-compose)" ]; then | ||
docker-compose up --detach | ||
else | ||
docker compose up --detach | ||
fi |
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 this redundant since it's in the post-create script?
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.
At first I had this only in post-start.sh
because it is needed to start docker
each time the machine starts, but I forgotten that I need to start once npm run migrate:dev:db
. Without this script application isn't working correctly.
Script post-create.sh
is executed only once, when the machine is created and it the right place to execute npm run migrate:dev:db
, but to run this the database needs to be started and so docker compose up --detach
is required.
Maybe it would be better to call sh ./post-start.sh
instead of this if
.
I'm not sure, if there should be another check if docker isn't running. Because on the first time post-create.sh
is executed and then post-start.sh
(two scripts, one after other). And then (everyother start of the machine) only post-start.sh
. But at the first time (when machine is created) docker compose up
is called two times. Not sure if this ends with error which of course can be ignored but is not nice. Let me check 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.
Running multiple times docker compose up
doesn't throws any errors it just displays that everything is running, then it is better to leave it this way, without checking it in the shell script.
In summary this block in post-create.sh
script can be replaced with call to sh ./post-start.sh
script, but I'm not sure what is the working directory, then it would be better to call it this way:
# Get script directory
DIR="$(cd "$(dirname "$0")" && pwd)"
# Start Docker before running: npm run migrate:dev:db
sh "$DIR/post-start.sh"
The DIR
variable can be set at the start of post-create.sh
script, because it could be used in fututre in other places (?).
Thanks for the extra context about it being for translations! I think we are excited to host more languages in the future and it sounds like someone from your team has been in touch with our farmer success manager @dtrapplitefarm so that is great since we are working on a new process for internationalization. If you are looking for other tools to help do translations with farmers, we have had another contribution that uses a chrome extension to do translations in context and generate the json files as well -- but it might be a little bit behind on our integration branch: #3227 We have not been able to integrate it yet... but the author demo-ed it to me and it seemed very useful too if you were interested in testing it out! |
Yes, that's me. |
@Ryszard-Trojnacki just an update since it's been a few days -- unfortunately we don't have much bandwidth to re-review this in depth at the moment, so it honestly might be a while before we get to it. On the other hand, as @Duncan-Brain mentioned, we have a new process for incorporating new languages to the app, and we also want to be mindful and carefully evaluate and plan for opportunities for adding new translations since each new language we decide to support requires effort and time from the core team. With this in mind, please kindly reach out and discuss with David, our Farmer Success Manager (I see that Duncan mentions that you're already in touch, so that's great) before opening a PR for a Polish translation. Thank you! |
Description
Configuration for GitHub Codespaces to be able to work with LiteFarm source code with only installed Visual Studio Code or via web browser.
Jira link: N/A
Type of change
How Has This Been Tested?
We are working with this configuration for 2 months developing polish translation.
Checklist: