Skip to content
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

[Issue/3270] Make docker context path be the parent of the beamable config folder #3374

Merged
merged 13 commits into from
May 14, 2024

Conversation

gabrielbeamable
Copy link
Contributor

Ticket

resolves #3270

Brief Description

While working on fixing the beam services run command, I found that because we use standalone microservices in different ways, for example in the Unity SDK, then we were previously, it means that the way we were handling the docker context path was wrong and would only work for what is inside the microservice folder, and not work with dependencies for example. This basically fixes that, making the docker context path be the parent folder of the beamable config folder in the project.

Notes

When you are merging a feature branch into main, please squash merge and make sure the final commit contains any relevent JIRA ticket number. If you are merging from main to staging, or staging to production, please use a regular merge commit.

Does this introduce tech-debt? If so, have you added an entry to the Tech-debt document?

@@ -353,9 +359,14 @@ private async Promise UpdateDockerFile(string serviceName)

foreach (var dependency in dependencies)
{
string depName = dependency.name;
newText = newText.Replace(endTag, replacement.Replace(serviceNameTag, depName));
string path = _configService.GetRelativeToBeamableFolderPath(dependency.projPath);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be relative to the docker context path.

@@ -309,11 +309,12 @@ public async Task AddProjectDependency(BeamoServiceDefinition project, BeamoServ
public static bool ValidateBeamoServiceId_DoesntExists(string beamoServiceId, List<BeamoServiceDefinition> serviceDefinitions) =>
!serviceDefinitions.Contains(new BeamoServiceDefinition() { BeamoId = beamoServiceId }, new BeamoServiceDefinition.IdEquality());

private async Promise UpdateDockerFile(string serviceName)
public async Promise UpdateDockerFile(BeamoServiceDefinition serviceDefinition)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call this from services run and services deploy

{
if (line.StartsWith("COPY"))
{
var parts = line.Split(" ");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use remove empty entries here, and check if this array has COPY SOURCE DESTINATION, 3 elements, then it's correct. And throw specific exceptions that we care about in the GetAttributes call

@@ -34,6 +34,11 @@ public partial class BeamoLocalSystem
BeamoProtocolType.HttpMicroservice,
async (definition, protocol) =>
{
if (string.IsNullOrEmpty(buildContexPath))
{
buildContexPath = _configService.GetDockerBuildContextPath();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this parameter and just get the value from this method from ConfigService

Copy link
Contributor

Lightbeam link

Copy link
Contributor

Lightbeam link

Copy link
Contributor

Lightbeam link

Copy link
Contributor

Lightbeam link

Copy link
Collaborator

@cdhanna cdhanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💣

@gabrielbeamable gabrielbeamable merged commit 2a68173 into main May 14, 2024
26 checks passed
@gabrielbeamable gabrielbeamable deleted the issue/3270 branch May 14, 2024 14:21
github-actions bot pushed a commit that referenced this pull request May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLI - services run not aways working
3 participants