Skip to content

Commit ea33f26

Browse files
authored
Merge pull request #256 from ligangty/release
1.3.2 release
2 parents 22ffac6 + 4294def commit ea33f26

File tree

8 files changed

+118
-80
lines changed

8 files changed

+118
-80
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ package/
1313
.local
1414
local
1515
.DS_Store
16+
*.whl
17+
1618

1719
# Unit test
1820
__pytest_reports

Dockerfile

Lines changed: 0 additions & 58 deletions
This file was deleted.

README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ This command will upload the repo in tarball to S3.
6060
It will auto-detect if the tarball is for maven or npm
6161

6262
* For maven type, it will:
63+
6364
* Scan the tarball for all paths and collect them all.
6465
* Check the existence in S3 for all those paths.
6566
* Filter out the paths in tarball based on:
@@ -70,10 +71,8 @@ It will auto-detect if the tarball is for maven or npm
7071
* Upload these artifacts to S3 with metadata of the product.
7172
* If the artifacts already exists in S3, update the metadata
7273
of the product by appending the new product.
73-
7474
* NPM type (TBH): We need to know the exact tarball structure
7575
of npm repo
76-
7776
* For both types, after uploading the files, regenerate/refresh
7877
the index files for these paths.
7978

@@ -107,10 +106,30 @@ This command will refresh the index.html for the specified path.
107106

108107
* Note that if the path is a NPM metadata path which contains package.json, this refreshment will not work because this type of folder will display the package.json instead of the index.html in http request.
109108

110-
### charon-validate: validate the checksum of files in specified path in a maven repository
109+
### charon-cf-check: check the invalidation status of the specified invalidation id for AWS CloudFront
110+
111+
```bash
112+
usage: charon cf check $invalidation_id [-t, --target] [-D, --debug] [-q, --quiet]
113+
```
114+
115+
### charon-cf-invalidate: do invalidating on AWS CloudFront for the specified paths
116+
117+
```bash
118+
usage: charon cf invalidate [-t, --target] [-p, --path] [-f, --path-file] [-D, --debug] [-q, --quiet]
119+
```
120+
121+
### charon-checksum-validate: validate the checksum of files in specified path in a maven repository
111122

112123
```bash
113-
usage: charon validate $path [-t, --target] [-f, --report_file_path] [-i, --includes] [-r, --recursive] [-D, --debug] [-q, --quiet]
124+
usage: charon checksum validate $path [-t, --target] [-f, --report_file_path] [-i, --includes] [-r, --recursive] [-D, --debug] [-q, --quiet]
114125
```
115126

116127
This command will validate the checksum of the specified path for the maven repository. It will calculate the sha1 checksum of all artifact files in the specified path and compare with the companied .sha1 files of the artifacts, then record all mismatched artifacts in the report file. If some artifact files misses the companied .sha1 files, they will also be recorded.
128+
129+
### charon-checksum-refresh: refresh the checksum files for the artifacts in the specified maven repository
130+
131+
```bash
132+
usage: charon checksum refresh [-t, --target] [-p, --path] [-f, --path-file] [-D, --debug] [-q, --quiet]
133+
```
134+
135+
This command will refresh the checksum files for the specified artifact files in the maven repository. Sometimes the checksum files are not matched with the artifacts by some reason, so this command will do the refresh to make it match again. It will calculate the checksums of all artifact files in the specified path and compare with the companied checksum files of the artifacts, if the checksum are not matched, they will be refreshed.

config/charon.yaml.sample

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#aws_profile: ${profile}
2+
#aws_cf_enable: True
3+
14
ignore_patterns:
25
- ".*^(redhat).*"
36
- ".*snapshot.*"
@@ -30,3 +33,5 @@ targets:
3033
- bucket: "stage-npm-npmjs"
3134
prefix: /
3235
registry: "npm.stage.registry.redhat.com"
36+
37+
#manifest_bucket: manifest

image/Containerfile

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
####
2+
# This Containerfile is used to build the container for charon
3+
#
4+
# charon requires python 3
5+
#
6+
# 0. Step into the project dir
7+
#
8+
# 1. Build the image
9+
# docker/podman build -t charon:1.0.0 -f image/Containerfile .
10+
#
11+
# 2. Run the container as daemon, mount the host ~/upload/ path to container /root/upload/ path,
12+
# the uploading path is the dir location where you will upload the tarballs from
13+
# add -e to set specific environment variables, such as: AWS_PROFILE, aws_endpoint_url, bucket
14+
# docker/podman run -dit -v ~/upload/:/home/charon/upload/ --name charon charon:1.0.0
15+
#
16+
# 3. Execute the container
17+
# docker/podman exec -it charon bash
18+
#
19+
# 4. Start using uploader
20+
# charon upload/delete from /home/charon/upload/...
21+
###
22+
FROM registry.access.redhat.com/ubi8-minimal:latest as builder
23+
24+
ARG GIT_BRANCH=main
25+
26+
RUN microdnf install -y git-core python3.12 python3.12-pip && microdnf clean all
27+
RUN git clone -b ${GIT_BRANCH} --depth 1 https://github.com/Commonjava/charon.git
28+
RUN pip3 install --no-cache-dir --upgrade pip
29+
RUN pip3 wheel ./charon
30+
31+
FROM registry.access.redhat.com/ubi8-minimal:latest
32+
33+
ARG USER=charon
34+
ARG UID=10000
35+
ARG HOME_DIR=/home/${USER}
36+
37+
WORKDIR ${HOME_DIR}
38+
39+
USER root
40+
41+
RUN microdnf install -y python3.12 python3.12-pip shadow-utils && microdnf clean all
42+
RUN useradd -d ${HOME_DIR} -u ${UID} -g 0 -m -s /bin/bash ${USER} \
43+
&& chown ${USER}:0 ${HOME_DIR} \
44+
&& chmod -R g+rwx ${HOME_DIR} \
45+
&& chmod g+rw /etc/passwd
46+
47+
COPY --from=builder ./*.whl ./
48+
RUN pip3 install --no-cache-dir --upgrade pip
49+
RUN pip3 install --no-cache-dir ./*.whl
50+
RUN rm ./*.whl
51+
52+
RUN microdnf remove python3.12-pip shadow-utils && microdnf clean all
53+
54+
USER ${USER}
55+
56+
ENV HOME=${HOME_DIR} \
57+
LANG=en_US.UTF-8
58+
59+
CMD ["/usr/local/bin/charon"]

requirements.txt

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
setuptools-rust==1.7.0
2-
Jinja2==3.1.4
3-
boto3==1.28.46
4-
botocore==1.31.46
5-
click==8.1.7
6-
requests==2.31.0
7-
PyYAML==6.0.1
8-
defusedxml==0.7.1
9-
subresource-integrity==0.2
10-
jsonschema==4.19.0
11-
urllib3==1.26.18
1+
Jinja2>=3.1.4
2+
boto3>=1.28.46
3+
botocore>=1.31.46
4+
click>=8.1.7
5+
requests>=2.31.0
6+
PyYAML>=6.0.1
7+
defusedxml>=0.7.1
8+
subresource-integrity>=0.2
9+
jsonschema>=4.19.0
10+
urllib3>=1.26.18
11+
semantic-version>=2.10.0
12+
setuptools>=70.0.0

setup.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,8 @@
1515
"""
1616
from setuptools import setup, find_packages
1717

18-
version = "1.3.1"
18+
version = "1.3.2"
1919

20-
# f = open('README.md')
21-
# long_description = f.read().strip()
22-
# long_description = long_description.split('split here', 1)[1]
23-
# f.close()
2420
long_description = """
2521
This charon is a tool to synchronize several types of
2622
artifacts repository data to RedHat Ronda service (maven.repository.redhat.com).
@@ -50,4 +46,18 @@
5046
entry_points={
5147
"console_scripts": ["charon = charon.cmd:cli"],
5248
},
49+
install_requires=[
50+
"Jinja2>=3.1.4",
51+
"boto3>=1.28.46",
52+
"botocore>=1.31.46",
53+
"click>=8.1.7",
54+
"requests>=2.31.0",
55+
"PyYAML>=6.0.1",
56+
"defusedxml>=0.7.1",
57+
"subresource-integrity>=0.2",
58+
"jsonschema>=4.19.0",
59+
"urllib3>=1.26.18",
60+
"semantic-version>=2.10.0",
61+
"setuptools>=70.0.0",
62+
],
5363
)

tests/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ pytest-cov
55
pytest-html
66
flake8
77
requests-mock
8-
moto==5.0.3
9-
python-gnupg==0.5.0
8+
moto>=5.0.3,<6
9+
python-gnupg>=0.5.0,<1

0 commit comments

Comments
 (0)