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

[area/documentation] (#162) Minimal infrastructure setup update #384

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ivan-zdravkov
Copy link

Description

The minimal infrastructure documentation now guides us through setting up all the application docker containers that host the infrastructure, the connectivity and application access, the dev environment, creating a project from archetypes, running and testing the project locally, setting up the GitLab CI/CD pipeline, and finally building, deploying and pushing artifacts.

Shell file removed as it is no longer needed.

docker-compose updated to work with nginx, nexus, gitlab, and a custom gitlab-runner.

.m2/settings.xml added to the infrastructure folder.

gitlab-runner Dockerfile added with openjdk, maven and nodejs on top.

nginx configuration changed.

Checklist

  • I have added relevant error handling and logging messages to help troubleshooting
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation, relevant usage information (if applicable)
  • I have updated the PR title with affected component, related issue number and a short summary of the changes introduced
  • I have added labels for implementation kind (kind/) and version type (version/)
  • I have tested against live environment, if applicable
  • I have synced any structure and/or content vRA-NG improvements with vra-ng and ts-vra-ng archetypes (if applicable)
  • I have my changes rebased and squashed to the minimal number of relevant commits. Notice: don't squash all commits
  • I have added a descriptive commit message with a short title, including a Fixed #XXX - or Closed #XXX - prefix to auto-close the issue

Testing

Full testing can be done by following the changed Readme.md as that is the intention of the changes.

Release Notes

The minimal infrastructure guide updated and simplified to better lead adoption.

Related issues and PRs

#162

@ivan-zdravkov ivan-zdravkov added the area/documentation Relates to improvements or additions to documentation label Aug 9, 2024
@ivan-zdravkov ivan-zdravkov linked an issue Aug 9, 2024 that may be closed by this pull request
Comment on lines +22 to +32
<repository>
<id>releases</id>
<name>pscoe</name>
<url>http://infra.corp.local/nexus/repository/maven-releases/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>

Check failure

Code scanning / CodeQL

Failure to use HTTPS or SFTP URL in Maven artifact upload/download High

Downloading or uploading artifacts over insecure protocol (eg. http or ftp) to/from repository http://infra.corp.local/nexus/repository/maven-releases/
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ivan-zdravkov @ivo-kotev @Michaelpalacce those https alerts should be safe to dismiss in this specific case right? this is adding the basic configuration to get things running and it can later be updated easily based on customer preference

Copy link
Author

@ivan-zdravkov ivan-zdravkov Aug 12, 2024

Choose a reason for hiding this comment

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

@VenelinBakalov, yes exactly. We are overriding this security requirement in the settings.xml itself (Maven requires https) as well since this is strictly internal traffic. Maybe we should make a note of that in the documentation.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm 50/50 on the matter. We should be able to serve HTTPS with self-signed certificates. But either work for me. The error itself is whatever in this case, but at the same time https > http even for this

infrastructure/.m2/settings.xml Dismissed Show dismissed Hide dismissed
@@ -1,6 +0,0 @@
# vRA IaaC START SECTION
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see we are removing this file, are things working without it? is it the "extra_hosts" property the one that replaces hosts configuration (just note, i am asking because I don't have a lot of knowledge in this area and not as a change request for the pr)

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, we don't need this. I initially tried getting it to work, but never could. It appeared to be obsolete even initially, since we are not using the thus defined hosts, but instead the base infra.corp.local. Docker compose configures internal image-to-image hosts and addresses and on the host machine we only need the infra.corp.local 127.0.0.0 binding.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see thanks.

* 172.18.0.11 - gitlab.corp.local (GitLab CE)
* 172.18.0.12 - gitlab-runner.corp.local (GitLab CI Runner)
* 172.18.0.13 - artifactory.corp.local (JFrog Artifactory)
Using these applications, the infrastructure will support source control, running the build pipeline as well as hosting and serving the artifact packages, which are all the minimal requirements to have an [Aria Build Tools](../README.md) project.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Using these applications, the infrastructure will support source control, running the build pipeline as well as hosting and serving the artifact packages, which are all the minimal requirements to have an [Aria Build Tools](../README.md) project.
Using these applications, the infrastructure will support source control, running the build pipeline as well as hosting and serving the artifact packages, which are all the minimal requirements to have an [Build Tools for VMware Aria](../README.md) project.


2. Navigate to the `infrastructure` folder:
```
cd infrastructure
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
cd infrastructure
cd build-tools-for-vmware-aria/infrastructure

ports:
- "127.0.0.1:8080:80"
- 8082:80 # Web Interface
Copy link
Collaborator

Choose a reason for hiding this comment

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

Interesting but for the gitlab-ce i got an error: "ERROR: for gitlab Cannot create container for service gitlab: invalid port specification: "481342"
In order to fix it, I had to use quotes. I am not sure why it happened only for this container..
ports:
- "8082:80" # Web Interface
- "8022:22" # SSH

@VenelinBakalov VenelinBakalov added version/minor Introduces a non-breaking feature or change kind/feature New Feature to the project labels Aug 16, 2024
@VenelinBakalov VenelinBakalov changed the title [area/documentation] Minimal infrastructure documentation updated. [area/documentation] Minimal infrastructure setup update Aug 16, 2024
@VenelinBakalov VenelinBakalov changed the title [area/documentation] Minimal infrastructure setup update [area/documentation] (#162) Minimal infrastructure setup update Aug 16, 2024
@VenelinBakalov VenelinBakalov added the area/build Relates to the build process label Aug 16, 2024
@ivan-zdravkov
Copy link
Author

I will be updating the guide for Linux and update the Installation section to drop the Docker Desktop dependencies

@vmwclabot
Copy link
Member

@ivan-zdravkov, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

1 similar comment
@vmwclabot
Copy link
Member

@ivan-zdravkov, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@vmwclabot
Copy link
Member

@ivan-zdravkov, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

1 similar comment
@vmwclabot
Copy link
Member

@ivan-zdravkov, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

Ivan Zdravkov and others added 2 commits September 19, 2024 07:14
The minimal infrastructure documentation now
guides us through setting up all the application
docker containers that host the infrastructure,
the connectivity and application access, the dev
environment, creating a project from archetypes,
running and testing the project locally,
setting up the GitLab CI/CD pipeline, and finally
building, deploying and pushing artifacts.

Shell file removed as it is no longer needed.

docker-compose updated to work with nginx, nexus,
gitlab, and a custom gitlab-runner.

.m2/settings.xml added to the infrastructure
folder.

gitlab-runner Dockerfile added with openjdk,
maven and nodejs on top.

nginx configuration changed.

Fixed #162

Signed-off-by: Ivan Zdravkov <[email protected]>
@vmwclabot
Copy link
Member

@ivan-zdravkov, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

1 similar comment
@vmwclabot
Copy link
Member

@ivan-zdravkov, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

- echo "GROUP_ID=$(mvn help:evaluate -Dexpression=project.groupId -q -DforceStdout)" >> build.env
- echo "ARTIFACT_ID=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)" >> build.env
- echo "PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> build.env
artifacts:
Copy link
Collaborator

Choose a reason for hiding this comment

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

For some reason the artifacts part fails to execute

WARNING: Uploading artifacts as "dotenv" to coordinator... POST http://infra.corp.local/gitlab/api/v4/jobs/1/artifacts: 400 Bad Request (Invalid Format)  id=1 responseStatus=400 Bad Request status=400 token=glcbt-64
FATAL: invalid argument                            
ERROR: Job failed: exit status 1

Commenting this out makes the build successful

test:
stage: test
script:
- mvn test
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- mvn test
- mvn -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository test

<repositories>
<repository>
<id>releases</id>
<name>pscoe</name>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<name>pscoe</name>
<name>maven-releases</name>

Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure if the name here needs to match the name in nexus but if it does, we can update it

</repository>
<repository>
<id>snapshots</id>
<name>pscoe</name>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<name>pscoe</name>
<name>maven-snapshots</name>

@vmwclabot
Copy link
Member

@ivan-zdravkov, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

1 similar comment
@vmwclabot
Copy link
Member

@ivan-zdravkov, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@vmwclabot
Copy link
Member

@ivan-zdravkov, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

1 similar comment
@vmwclabot
Copy link
Member

@ivan-zdravkov, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@vmwclabot
Copy link
Member

@ivan-zdravkov, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

1 similar comment
@vmwclabot
Copy link
Member

@ivan-zdravkov, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

Signed-off-by: Ivan Zdravkov <[email protected]>
@vmwclabot
Copy link
Member

@ivan-zdravkov, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

1 similar comment
@vmwclabot
Copy link
Member

@ivan-zdravkov, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@vmwclabot
Copy link
Member

@ivan-zdravkov, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

1 similar comment
@vmwclabot
Copy link
Member

@ivan-zdravkov, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

<profiles>
<profile>
<id>nexus</id>
<repositories>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<repositories>
<properties>
<releaseRepositoryUrl>
http://infra.corp.local/nexus/repository/maven-releases/</releaseRepositoryUrl>
<snapshotRepositoryUrl>
http://infra.corp.local/nexus/repository/maven-snapshots/</snapshotRepositoryUrl>
</properties>
<repositories>

<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<servers>
<server>
<id>nexus</id>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<id>nexus</id>
<id>releases</id>

And we need to add 1 more similar server with id snapshots

        <server>
            <id>snapshots</id>
            <username>admin</username>
            <password>VMware1!</password>
        </server>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build Relates to the build process area/documentation Relates to improvements or additions to documentation dco-required kind/feature New Feature to the project version/minor Introduces a non-breaking feature or change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a minimal infrastructure template
4 participants