merged README from 6.x

This commit is contained in:
Vinay Aggarwal
2020-03-26 08:15:59 -07:00
parent 7d661f35f5
commit 0b633a6b4c
3 changed files with 72 additions and 100 deletions

View File

@@ -0,0 +1,46 @@
# JFrog Container Registry for AWS Container Marketplace
JFrog Container Registry can be installed into either an ECS or EKS cluster.
### Prerequisites
* AWS account
* EKS or ECS cluster
#### Recommended requirements
* S3
* ELB/ALB
* RDS
* Valid SSL certificate
* EBS (for persistent storage)
### For testing only
To simply get up and running, you can try:
```docker run -d -p 8081:8081 -p 8082:8082 <image-url>```
After this, you can access the UI at \<URL\>:8081. The default username is 'admin'. See 'Getting or setting initial password' to find out how to get the initial password.
### Getting or setting initial password
If no initial password is provided for the default user 'admin', one will be generated and saved to the container at '/var/opt/jfrog/artifactory/generated-pass.txt'.
You can print it out with a Docker command:
```docker exec -it <container-id> cat /var/opt/jfrog/artifactory/generated-pass.txt```
You can also set a default password by passing it as an environment variable (ARTIFACTORY_PASSWORD) during container creation:
```docker run -d -p 8081:8081 --env ARTIFACTORY-PASSWORD=<PASSWORD> <image-url>```
### For production
1. Set up an [RDS](https://aws.amazon.com/rds/) (PSQL is the preferred database)
2. Set up an [S3 bucket](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#create-bucket-intro)
3. Run the Docker image, pointing it to the RDS, S3 and to some persistent storage (EBS)
* See [S3 Binarystore Configuration](https://www.jfrog.com/confluence/display/JCR/Configuring+the+Filestore#ConfiguringtheFilestore-AmazonS3OfficialSDKTemplate) for more information
* See [Configuring the databse](https://www.jfrog.com/confluence/display/JCR/Configuring+the+Database) for more information
* See [Extra Configuration](https://www.jfrog.com/confluence/display/JCR/Installing+with+Docker#InstallingwithDocker-ExtraConfigurationDirectory) to learn how to pass this information to the Docker container
* Create a medium sized mount point (~50GB) on /var/opt/jfrog/artifactory. See [Managing Data Persistence](https://www.jfrog.com/confluence/display/JCR/Installing+with+Docker#InstallingwithDocker-ManagingDataPersistence)
4. Expose the service (running on port 8081) via a load balancer to port 443
* Docker requires a valid SSL certificate
5. Learn how to use your [JFrog Container Registry](https://www.jfrog.com/confluence/display/JCR/Overview)
* See 'Getting or setting initial password'

View File

@@ -1,27 +0,0 @@
{
"router": {
"node_id": "1dae71383ae3",
"state": "HEALTHY",
"message": "OK"
},
"services": [
{
"service_id": "jfac@01e49jb08bm7051xb2rp9k1ed8",
"node_id": "1dae71383ae3",
"state": "UNHEALTHY_PEER",
"message": "Service is healthy; there is at least one unhealthy service; there are missing services: jffe"
},
{
"service_id": "jfmd@01e49jbpqfhn39k8z3kyvqepzh",
"node_id": "1dae71383ae3",
"state": "UNHEALTHY_PEER",
"message": "Service is healthy; there is at least one unhealthy service; there are missing services: jffe"
},
{
"service_id": "jfrt@01e49jcq7t96ag11tq25h60759",
"node_id": "1dae71383ae3",
"state": "UNHEALTHY",
"message": "unexpected response status code: 503"
}
]
}

View File

@@ -1,89 +1,88 @@
#!/usr/bin/env bash
VERSION=$1
EDITIONS=( artifactory-pro artifactory-jcr )
#EDITIONS=( artifactory-jcr )
#EDITIONS=( artifactory-pro )
#for loop start: editoins
for EDITION in "${EDITIONS[@]}"
do
UPSTREAM_IMAGE_NAME=docker.bintray.io/jfrog/$EDITION
BUILD_IMAGE_NAME=partnership-public-images.jfrog.io/aws/$EDITION
ARTIFACTORY_PASSWORD=corona1831
UPSTREAM_IMAGE_NAME=docker.bintray.io/jfrog/$EDITION
BUILD_IMAGE_NAME=partnership-public-images.jfrog.io/aws/$EDITION
ARTIFACTORY_PASSWORD=corona1831
# Logic starts here
if [ -z "$VERSION" ]
then
echo "No version passed in. Build failed."
echo "usage: buildAwsContainers <vesion> <edition>"
echo "example: buildAwsContainers artifactory-pro 7.2.1 "
exit -1
fi
# Logic starts here
if [ -z "$VERSION" ]
then
echo "No version passed in. Build failed."
echo "usage: buildAwsContainers <vesion>"
echo "example: buildAwsContainers 7.2.1 "
exit -1
fi
# Extract and modify the entrypoint to run out custom code for first-time password
docker pull $UPSTREAM_IMAGE_NAME:$VERSION
docker run -d --rm --name tmp-docker $UPSTREAM_IMAGE_NAME:$VERSION
docker cp tmp-docker:/entrypoint-artifactory.sh original-entrypoint.sh
docker rm -f tmp-docker
perl -pe 's/^addExtraJavaArgs$/`cat extra_conf`/ge' original-entrypoint.sh > entrypoint-artifactory.sh
# Extract and modify the entrypoint to run out custom code for first-time password
docker pull $UPSTREAM_IMAGE_NAME:$VERSION
docker run -d --rm --name tmp-docker $UPSTREAM_IMAGE_NAME:$VERSION
docker cp tmp-docker:/entrypoint-artifactory.sh original-entrypoint.sh
docker rm -f tmp-docker
perl -pe 's/^addExtraJavaArgs$/`cat extra_conf`/ge' original-entrypoint.sh > entrypoint-artifactory.sh
#Create installer-info file
if [ "$EDITION" == "artifactory-pro" ]
then
cat <<EOF > installer-info.json
{
"productId": "CloudFormation_artifactory-ha/$VERSION",
"features": [
#Create installer-info file
if [ "$EDITION" == "artifactory-pro" ]
then
cat <<" EOF" > installer-info.json
{
"featureId": "Partner/ACC-006973"
"productId": "CloudFormation_artifactory-ha/$VERSION",
"features": [
{
"featureId": "Partner/ACC-006973"
}
]
}
]
}
EOF
else
cat <<EOF > installer-info.json
{
"productId": "CloudFormation_artifactory-jcr/$VERSION",
"features": [
EOF
else
cat <<" EOF" > installer-info.json
{
"featureId": "Partner/ACC-006973"
"productId": "CloudFormation_artifactory-jcr/$VERSION",
"features": [
{
"featureId": "Partner/ACC-006973"
}
]
}
]
}
EOF
fi
cat installer-info.json
EOF
fi
cat installer-info.json
# Create the new docker image
docker build --no-cache --build-arg UPSTREAM_TAG=$VERSION -t $BUILD_IMAGE_NAME:$VERSION .
# Create the new docker image
docker build --no-cache --build-arg UPSTREAM_TAG=$VERSION -t $BUILD_IMAGE_NAME:$VERSION .
# Run minimal test
set -x
docker run --name test-new-image -d -e ARTIFACTORY_PASSWORD=$ARTIFACTORY_PASSWORD -p 8081:8081 -p 8082:8082 $BUILD_IMAGE_NAME:$VERSION
# Wait for it to come up
SUCCESS=false
for i in {1..30}
do
STATUS=$(curl -u admin:$ARTIFACTORY_PASSWORD http://localhost:8082/router/api/v1/system/health | jq .services[0].state)
if [ "$STATUS" == "\"HEALTHY\"" ]; then
echo "Build successful!"
SUCCESS=true
break
fi
echo "Container is not up yet, waiting 10 seconds..."
sleep 10
done
if [ "$SUCCESS" = true ] ; then
echo "Test Succeeded. Build succeeded."
else
echo "Test failed. Build failed. Removing docker image"
fi
#clearnup
docker stop test-new-image
docker rm test-new-image
rm installer-info.json
#for loop endL: editions
# Run minimal test
set -x
docker run --name test-new-image -d -e ARTIFACTORY_PASSWORD=$ARTIFACTORY_PASSWORD -p 8081:8081 -p 8082:8082 $BUILD_IMAGE_NAME:$VERSION
# Wait for it to come up
SUCCESS=false
for i in {1..30}
do
STATUS=$(curl -u admin:$ARTIFACTORY_PASSWORD http://localhost:8082/router/api/v1/system/health | jq .services[0].state)
if [ "$STATUS" == "\"HEALTHY\"" ]; then
echo "Build successful!"
SUCCESS=true
break
fi
echo "Container is not up yet, waiting 10 seconds..."
sleep 10
done
#clearnup
docker stop test-new-image
docker rm test-new-image
rm installer-info.json
if [ "$SUCCESS" = true ] ; then
echo "Test Succeeded. Build succeeded."
else
echo "Test failed. Build failed. Removing docker image"
exit 1
fi
#for loop endL: editions
done